In the development of iso applications, we need to consider that the height of the 3.5-inch screen of ip4 is different from that of the 4-inch screen of ip5. Common problems include the position of the scroll bar and the block at the bottom. I encountered the problem of refreshing the display position of the indicator when I added the push-down and refresh function in tableview.
I wrote a pull-up and refresh plug-in based on the existing code on the Internet: http://git.oschina.net/supdo/SDRefresh;
The plug-in sets the display position of the refresh Indicator Based on the height of tableview. to work properly, I manually set the height of tableview in the application. The Code is as follows:
-(Void) viewDidLayoutSubviews {[super viewWillLayoutSubviews]; CGSize screenSize = [UIScreen mainScreen]. bounds. size; self. myBlogTable. frame = CGRectMake (0, 0, screenSize. width, screenSize. height); self. myBlogTable. contentInset = UIEdgeInsetsMake (64 + 50, 0, 49, 0); self. myBlogTable. scrollIndicatorInsets = UIEdgeInsetsMake (64 + 50, 0, 49, 0); if (! IsLayoutSubview) {isLayoutSubview = YES; self. blogParser. header = [SDRefreshHeader addHeader: self. myBlogTable headerDelegate: self]; self. blogParser. footer = [SDRefreshFooter addFooter: self. myBlogTable footerDelegate: self]; loadMsg = [[SDMessage alloc] initWithSuper: self. view width: 200]; loadMsg. mode = SDMessageModeTextLoading; loadMsg. position = SDMessagePositionMiddle; [loadMsg showMessage: @ "loading... "]; [self. hdWeb DefaultPage] ;}}
In this way, the tableins work normally after the tableview height is set based on the screen height. Note that tableview cannot be placed in the view on the third layer, the problem I encountered was to put tableview in the view on the third layer. The highly adaptive code set here is invalid.
However, it should be set somewhere on the storyboard. I haven't found it yet.
Article link: http://quke.org/post/ios-35and40-height.html (reprinted please indicate the source of this article and article link)