Hide
Self.tableView.showsVerticalScrollIndicator = NO;
Modify ColorSelf.tableview.indicatorstyle=uiscrollviewindicatorstylewhite;UITableView Scroll to the specified line section
Nsindexpath *indexpath = [Nsindexpathindexpathforrow: 0 insection: 2];
CGRect frame = [tableviewRectforsection:indexpath. Section];
[TableView setcontentoffset: Cgpointmake(0, Frame.origin. Y) animated:YES ];
uitableview--Click a line to move to the specified location
Blog Category:
When you select a row and want to tableview auto-scroll so that the selected row is always on table top, middle, or bottom, use one of the following methods:
[TableView scrolltorowatindexpath: Indexpath atscrollposition: Uitableviewscrollpositionbottom Animated :YES];
[TableView Scrolltonearestselectedrowatscrollposition:uitableviewscrollpositionbottom Animated:yes];
H file: Java code
- @interface Gkviewcontroller:uiviewcontroller <uitableviewdatasource,uitableviewdelegate>{
- BOOL bcheck[50];
- }
M File: Java code
- -(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section
- {
- return 50;
- }
- -(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) Indexpath
- {
- if (Bcheck[indexpath.row]) {
- return 100;
- }else{
- return 50;
- }
- return 50;
- }
- -(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath
- {
- static NSString *cellidentifier = @"Cell";
- UITableViewCell *cell = [TableView dequeuereusablecellwithidentifier:cellidentifier];
- if (cell = = nil)
- {
- cell= [[UITableViewCell Alloc]initwithstyle:uitableviewcellstyledefault
- Reuseidentifier:cellidentifier];
- Cell.accessorytype=uitableviewcellaccessorydisclosureindicator;
- }
- Cell.textlabel.text=[nsstring stringwithformat:@"%@%i", @"topic", Indexpath.row];
- return cell;
- }
- -(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) Indexpath
- {
- [Self initcheck];
- Bcheck[indexpath.row] = YES;
- [TableView Reloaddata];
- Bcheck[indexpath.row] = NO;
- [TableView Scrolltorowatindexpath:indexpath Atscrollposition:uitableviewscrollpositionbottom Animated:YES];
- [TableView Scrolltonearestselectedrowatscrollposition:uitableviewscrollpositionbottom Animated:yes];
- }
Hides the UITableView scroll bar and modifies the color of the scrollbar, UITableView scrolls to the specified line section