1.scrollview frame refers to its visual range, contentsize refers to its scroll range, respectively, in the horizontal and vertical direction of the
So to let the scrollview in the horizontal direction cannot scroll, then needs the following setting
_scrollview = [[Uiscrollview alloc]initwithframe:cgrectmake (00= Cgsizemake (0, kscreenheight*3);
To enable the ScrollView to scroll, the properties of the contentsize in one Direction are larger than the frame, otherwise the scrolling area is small and the content can be displayed all without scrolling.
2. Set the Uicollectionview to the left and right sides of the screen, you can use
-(Uiedgeinsets) CollectionView: (Uicollectionview *) CollectionView layout: (Uicollectionviewlayout *) Collectionviewlayout Insetforsectionatindex: (nsinteger) section{ return Uiedgeinsetsmake (0 0); // top, left, bottom, right, respectively
Before adding the method
After you add the method
The above method and
0;
These two properties to co-regulate the location of the Uicollectionview cell
3. Change the keyboard return to send, you can use
Self.myTextView.returnKeyType = Uireturnkeysend;
However, there is still a problem, click Send is still a newline, should do processing
-(BOOL) TextView: (Uitextview *) TextView Shouldchangetextinrange: (nsrange) Range Replacementtext: (NSString *) text { if ([text isequaltostring:@ "\ n"]) {return // make return key invalid } return YES;
To listen for the Send event is also in the above method
-(BOOL) TextView: (Uitextview *) TextView Shouldchangetextinrange: (nsrange) Range Replacementtext: (NSString *) text { if ([text isequaltostring:@ "\ n"]) {// Send event handling [Self.mytextview resignfirstresponder]; return // make return key invalid } return YES;
4. In TableView, if you want to select a line by default when you enter, you can use
[Self.firsttabelview selectrowatindexpath:indexpath animated:no scrollposition: Uitableviewscrollpositionnone];
iOS work notes (14)