简体   繁体   中英

Scrolling on UITableView shows bottom part of table cut off

I have a TableView in a View, and when it scrolls, the rounded part of the table at the bottom is cut off. I'd like it to behave like the Stocks app, where the table view is fixed with round corners and scrolling scrolls within the fixed rounded corners. How is that done?

在此处输入图片说明

First, add the QuartzCore framework library to your project if you haven't.

Then, in your UIViewController that manages the UITableView, do:

#import <QuartzCore/QuartzCore.h>

And then on viewDidLoad:

myTableView.layer.cornerRadius = 8;

And that will give it 8px rounded corners. The QuartzCore framework exposes a lot of very useful things that you can do with UIViews and their internal layers. Experiment away!

For your This Requirement i just tell you use ScrollView Help ... In ScrollView Just Put tableview and in viewWillAppear or where your data reload at that time put bellow code

     yourTableView.frame = CGRectMake(yourTableView.frame.origin.x,yourTableView.frame.origin.y, yourTableView.frame.size.width, yourTableView.contentSize.height);

    float ftbl = yourTableView.frame.origin.y + yourTableView.contentSize.height + 15;
    yourScrollView.contentSize=CGSizeMake(320, ftbl);

Here declare tableview type with Grouped if required.. Sure this useful to you ... :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM