Some Kit Kat tricks developed by iOS

Source: Internet
Author: User

TableView do not display the cell with no content?

Like this, I don't want to let the empty ones below show.

Very simple.

1 self.tableView.tableFooterView = [[UIView alloc] init];

Tried all the same.

After this sentence, it became.

What do I do if I customize the Leftbarbuttonitem left slide return gesture to fail?

1 self.navigationItem.leftBarButtonItem = [[Uibarbuttonitem alloc]2                                          Initwithimage:img3                                         style:uibarbuttonitemstyleplain4                                         target:self  5                                         action: @selector (Onback:)]; 6 Self.navigationController.interactivePopGestureRecognizer. delegate = (ID) self;

ScrollView inexplicable can not viewcontroller to the top how to do?

1 self.automaticallyadjustsscrollviewinsets = NO;

Keyboard event Write good irritability, all want to fall keyboard, how to do?

1. Buy a sturdy keyboard.

2. Using Iqkeyboardmanager (GitHub searchable), the waist is not sore after use, the leg is not sour.

Why is my app always out of the flow and what's wrong with it?

This artifact is called: Kmcgeigercounter, go to GitHub to carry it.

How to adjust the position of separaline without creating a new cell?

1 _mytableview.separatorinset = Uiedgeinsetsmake (000);

How to click Self.view to let the keyboard, need to add a tapgestures?

1 -(void) Touchesbegan: (Nsset *) touches withevent: (uievent *)event2{ 3    [Self.view Endediting:yes]; 4 }

How to set the default background image for each viewcontroller?

Use the base class Ah, juvenile.

Want to change in the code in the Xib add layoutattributes, but how to use code to find AH?

Pull your restraints like a button. Nslayoutattribute can also pull the line.

How to hide navigationbar when sliding like safari?

1 navigationcontroller.hidesbarsonswipe = Yes

Navigation bar return key The title of the belt is too annoying, how to let it disappear!

1 [[Uibarbuttonitem appearance] Setbackbuttontitlepositionadjustment:uioffsetmake (0,-60  )2                                                      Forbarmetrics:uibarmetricsdefault];

CoreData used to be very annoying, grammar and smelly and long, how to do?

Magicrecord

CollectionView How to realize tableview kind of hover header?

Csstickyheaderflowlayou

Can you use just one pan gesture instead of the uiswipegesture in all directions?

1- (void) Pan: (Uipangesturerecognizer *) Sender2 {3 typedef ns_enum (Nsuinteger, uipangesturerecognizerdirection) {4 uipangesturerecognizerdirectionundefined,5 Uipangesturerecognizerdirectionup,6 Uipangesturerecognizerdirectiondown,7 Uipangesturerecognizerdirectionleft,8 Uipangesturerecognizerdirectionright9 };Ten StaticUipangesturerecognizerdirection Direction =uipangesturerecognizerdirectionundefined; One Switch(sender.state) { A      CaseUigesturerecognizerstatebegan: { -         if(Direction = =uipangesturerecognizerdirectionundefined) { -Cgpoint velocity =[Sender VelocityInView:recognizer.view]; theBOOL isverticalgesture = fabs (VELOCITY.Y) >fabs (velocity.x); -             if(isverticalgesture) { -                 if(Velocity.y >0) { -Direction =Uipangesturerecognizerdirectiondown; +}Else { -Direction =Uipangesturerecognizerdirectionup; +                 } A             } at             Else { -                 if(Velocity.x >0) { -Direction =Uipangesturerecognizerdirectionright; -}Else { -Direction =Uipangesturerecognizerdirectionleft; -                 } in             } -         } to          Break; +     } -      Caseuigesturerecognizerstatechanged: { the         Switch(direction) { *              CaseUipangesturerecognizerdirectionup: { $ [self handleupwardsgesture:sender];Panax Notoginseng                  Break; -             } the              CaseUipangesturerecognizerdirectiondown: { + [self handledownwardsgesture:sender]; A                  Break; the             } +              Caseuipangesturerecognizerdirectionleft: { - [self handleleftgesture:sender]; $                  Break; $             } -              Caseuipangesturerecognizerdirectionright: { - [self handlerightgesture:sender]; the                  Break; -             }Wuyi             default: { the                  Break; -             } Wu         } -          Break; About     } $      Caseuigesturerecognizerstateended: { -Direction =uipangesturerecognizerdirectionundefined;  -          Break; -     } A     default: +          Break; the } -}

How can I stretch a picture so that it doesn't deform?
1.UIImage *image = [[UIImage imagenamed:@ "xxx"] stretchableimagewithleftcapwidth:10 topcapheight:10];

2.


How to play GIF when this card, there is no better library?

Flipboard is good for you: Https://github.com/Flipboard/FLAnimatedImage

How to add a pull-up refresh in a sentence?

Https://github.com/samvermette/SVPullToRefresh

1 [TableView addpulltorefreshwithactionhandler:^{2///  prepend data to DataSource, insert cells at the top of Table View3// call [Tableview.pulltorefreshview Stopanimating]when done4 } Position:svpulltorefreshpositionbottom];

How to change the color of the small tick of the cell in TableView to another color?

1 _mtableview.tintcolor = [Uicolor Redcolor];

Originally my statusbar is lightcontent, result with Uiimagepickercontroller will cause my statusbar style to turn black, how to do?

1 -(void) Navigationcontroller: (Uinavigationcontroller *) Navigationcontroller Willshowviewcontroller: (Uiviewcontroller *) Viewcontroller animated: (BOOL) animated2{ 3     [[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent]; 4 }

How do I make my navigationbar transparent instead of blurry?

1 New ]2                         Forbarmetrics:uibarmetricsdefault]; 3 New ]; 4 self.navigationBar.translucent = YES;

How to change the color and position of Uitextfield placeholder?

Inherit Uitextfield, override this method

1 -(void) Drawplaceholderinrect: (cgrect) rect {2    [[Uicolor Bluecolor] Setfill]; 3     [Self.placeholder drawinrect:rect withFont:self.font linebreakmode:uilinebreakmodetailtruncation Alignment:self.textAlignment]; 4 }

Why do you know so many strange tricks?

Go to StackOverflow brush problem ah, teenager!

Original address: http://www.cocoachina.com/ios/20141231/10783.html

Some Kit Kat tricks developed by iOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.