Finally, I found a way to solve the problem. Please see the code below.
In the viewDidLoad () method, I just set the preferred size of the content of the view to the base height that I need when I start to show my bottom view, and then I made a web service call to retrieve the data. After receiving the data, I again set the preferred content size of the TodayWidget view.
-(void)viewDidLoad { [super viewDidLoad]; self.bottomView.frame = CGRectMake(self.bottomView.frame.origin.x, 0.0, self.bottomView.frame.size.width, self.bottomView.frame.size.height); self.preferredContentSize = CGSizeMake(self.view.frame.size.width, self.bottomView.frame.size.height); [self getBookedAppointmentsNew]; } -(void)getBookedAppointmentsNew { //-- After web-service response (positive/negative), I have set again the preferred content size. self.bottomView.frame = CGRectMake(self.bottomView.frame.origin.x, self.scrollView.frame.size.height, self.bottomView.frame.size.width, self.bottomView.frame.size.height); self.preferredContentSize = CGSizeMake(self.view.frame.size.width, (self.bottomView.frame.origin.y + self.bottomView.frame.size.height)); }
I took the following steps to solve the problems “Unable to load” and “Screen flicker” using the “Today” extension.
source share