Some Problems in adaptive screen adaptation for ios 3.5 and 4.0 screens

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.