Buy a strong keyboard; Use IQKeyboardManager (search on GitHub). After use, the waist will not hurt, and the legs will not be sour.
5. Why is there a problem with my apps?
This artifact is called:KMCGeigerCounter, Go to GitHub.
6. How can I adjust the separaLine position without creating a Cell?
_ MyTableView. separatorInset = UIEdgeInsetsMake (0,100 );
7. How can I click self. view to collapse the keyboard? Do I need to add a tapGestures?
-(Void) touchesBegan :( NSSet *) toucheswithEvent :( UIEvent *) event {[self. viewendEditing: YES];}
8. How to set the Default background image for each ViewController?
Use the base class.
9. I want to change the layoutAttributes added in xib in the code, but how can I find it using the code?
Nslayoutattribute can also be used to pull your constraints like a Button.
10. How can I hide the navigationbar when sliding like Safari?
NavigationController. hidesBarsOnSwipe = Yes
11. The title of the navigation bar's return key is so annoying. How can I make it disappear?
View plaincopy [[UIBarButtonItemappearance] setBackButtonTitlePositionAdjustment: UIOffsetMake (0,-60) forBarMetrics: UIBarMetricsDefault];
12. CoreData is so annoying to use. What should I do if the syntax is smelly and long?
MagicRecord
13. How does CollectionView implement the hovering header of tableview?
CSStickyHeaderFlowLayout
14. Can I use only one pan gesture to replace all directions of UISwipegesture?
-(Void) pan :( UIPanGestureRecognizer *) sender {typedefNS_ENUM (NSUInteger, UIPanGestureRecognizerDirection) {average, minimum, minimum, and maximum}; switch (sender. state) {caseUIGestureRecognizerStateBegan: {if (direction = uipangesturerecognizerdiredireundefined) {CGPointvelocity = [sendervelocityInView: recognizer. view]; BOOLisVerticalGesture = fabs (velocity. y)> fabs (velocity. x); if (isVerticalGesture) {if (velocity. y> 0) {direction = UIPanGestureRecognizerDirectionDown;} else {direction = UIPanGestureRecognizerDirectionUp;} else {if (velocity. x> 0) {direction = uipangesturerecognizerdireright;} else {direction = direction ;}} break ;}:{ switch (direction) {direction: {[selfhandleUpwardsGesture: sender]; break;} condition: {[condition: sender]; break;} condition: {[selfhandleLeftGesture: sender]; break;} condition: {[selfhandleRightGesture: sender]; break ;} default: {break ;}} break ;}caseuigesturerecognizerstateended: {direction = uipangesturerecognizerdireundefined; break;} default: break ;}}
15. How can I make the image not deformed when stretching the image?
Method 1:
UIImage * image = [[UIImageimageNamed: @ "xxx"] stretchableImageWithLeftCapWidth: 10 topCapHeight: 10];
Note: A developer reminds me that this application has been disabled. The current method is resizableImageWithCapInsets.
Method 2,
16. Why is there a better library when playing GIF videos?
FlipBoardFLAnimatedImageThat's perfect for you.
17. How can I add pull-up refresh in one sentence?
Use the SVPullToRefresh Library:
[Dependencies: ^ {// prependdatatodataSource, insertcellsattopoftableview // call [tableView. pullToRefreshViewstopAnimating] whendone} position: SVPullToRefreshPositionBottom];
18. How can I change the Cell color in tableview to another color?
_ MTableView. tintColor = [UIColorredColor];
19. Originally, my statusbar was lightcontent. Using UIImagePickerController will make my statusbar style black. What should I do?
-(Void) navigationController :( UINavigationController *) navigationControllerwillShowViewController :( UIViewController *) viewControlleranimated :( BOOL) animated {[[UIApplicationsharedApplication] setStatusBarStyle: Custom];}
20. How can I make my navigationbar transparent instead of blurred?
[Self. navigationBarsetBackgroundImage: [UIImagenew] forBarMetrics: UIBarMetricsDefault]; self. navigationBar. shadowImage = [UIImagenew]; self. navigationBar. translucent = YES;
21. How can I change the color and position of uitextfield placeholder?
Inherit uitextfield and override this method:
-(Void) Configure :( CGRect) rect {[UIColorblueColor] setFill]; [self. placeholderdrawInRect: rectwithFont: self. fontlineBreakMode: Signature: self. textAlignment];}
22. Why do you know so many strange tricks?
Click Stack Overflow!