One, the effect chart.
Second, engineering drawings.
Three, code.
RootViewController.h
#import <UIKit/UIKit.h>
@interface rootviewcontroller:uiviewcontroller
<uiscrollviewdelegate, Uitableviewdelegate,uitableviewdatasource>
{
uiscrollview *_scrolview;
UITableView *_tableview;
UITableView *_tableview2;
UITableViewCell *_cell;
}
Rootviewconroller.m
#import "RootViewController.h" @interface Rootviewcontroller () @end @implementation Rootviewcontroller-(ID) initwithn Ibname: (NSString *) Nibnameornil Bundle: (NSBundle *) Nibbundleornil {self = [super Initwithnibname:nibnameornil bundle:n
Ibbundleornil];
if (self) {//Custom initialization} return self;
}-(void) viewdidload {[Super viewdidload];
Do no additional setup after loading the view.
[Self initbackgroundview]; #pragma-mark-functions-(void) Initbackgroundview {//tableview scroll bar _scrolview=[[uiscrollview alloc]initwithframe:
CGRectMake (0,19, 320, 460)];
_scrolview.contentsize=cgsizemake (320*2, 460);
_scrolview.delegate=self;
_scrolview.pagingenabled=yes;
_scrolview.showsverticalscrollindicator=no;
_scrolview.bounces=no;
[Self.view Addsubview:_scrolview];
TableView1 _tableview =[[uitableview alloc]initwithframe:cgrectmake (0, 19, 320, 460)];
_tableview.tag=1;
_tableview.delegate=self;
_tableview.datasource=self; _tableview. Scrollenabled=no;
[_scrolview Addsubview:_tableview];
TableView2 _tableview2=[[uitableview Alloc]initwithframe:cgrectmake (320, 19, 320, 460)];
_tableview2.tag=2;
_tableview2.delegate=self;
_tableview2.datasource=self;
_tableview2.scrollenabled=no;
[_scrolview Addsubview:_tableview2]; } #pragma-mark-uitableviewdelegate-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (NSInteger
) section {return 3;}-(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) Indexpath {
return 125; }-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) IndexPath {_cell=[
TableView dequeuereusablecellwithidentifier:@ "ID"];
if (_cell==nil) {_cell=[[uitableviewcell alloc]initwithstyle:uitableviewcellstyledefault reuseIdentifier:@ "ID"];
} _cell.selectionstyle=uitableviewcellselectionstylenone;
if (tableview.tag==1) {_cell.textlabel.text=@ "1"; }else if (tableview.tag==2) {_cell. textlabel.text=@ "2";
return _cell; }
The above content is a small part of the Android program to introduce the development of the Uiscrollerview has two TableView detailed introduction, I hope to help!