Contentsize is an area where scrollview can be scrolled, such as frame = (0, 0, +, 480) Contentsize = (320, 960), which means that your scrollview can scroll up and down, The scrolling area is twice times the size of the frame.
Contentoffset is the offset of the ScrollView current display area vertex relative to the frame vertex, such as the last example you pulled to the bottom, Contentoffset is (0, 480), that is, y offset the 480
Contentinset Is the position of the vertex of the ScrollView Contentview relative to the scrollview, such as your Contentinset = (0, 100), then your contentview is displayed from ScrollView (0, 100)
In addition UITableView is the subclass of Uiscrollview, they are different in the above attribute, Tabelview Contentsize is implemented by the following methods .
-(Nsinteger) numberofsections;
-(Nsinteger) Numberofrowsinsection: (nsinteger) section;
-(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) Indexpath;
-(CGFloat) TableView: (UITableView *) TableView heightforheaderinsection: (nsinteger) section;
-(CGFloat) TableView: (UITableView *) TableView heightforfooterinsection: (nsinteger) section;
it will automatically calculate all the heights and to make the height of the contentsize for it.
For example you're in the delegate method
-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section {
return;
}
The difference between contentsize Contentoffset Contentinset in IOS