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.

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?

    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]                                            initWithImage:img                                           style:UIBarButtonItemStylePlain                                            target:self                                           action: @selector (onback:)]; self.navigationcontroller.interactivepopgesturerecognizer.delegate =  (id) self;

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

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?

_mytableview.separatorinset = Uiedgeinsetsmake (0, 100, 0, 0);

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

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

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?

Navigationcontroller.hidesbarsonswipe = Yes

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

[[Uibarbuttonitem appearance] Setbackbuttontitlepositionadjustment:uioffsetmake (0,-60) 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?

-  (void) pan: (uipangesturerecognizer *) Sender{typedef ns_enum (nsuinteger,  Uipangesturerecognizerdirection)  {    UIPanGestureRecognizerDirectionUndefined,     UIPanGestureRecognizerDirectionUp,     uipangesturerecognizerdirectiondown,    uipangesturerecognizerdirectionleft,     uipangesturerecognizerdirectionright};static uipangesturerecognizerdirection direction  = UIPanGestureRecognizerDirectionUndefined;switch  (sender.state)  {     case UIGestureRecognizerStateBegan: {        if  ( direction == uipangesturerecognizerdirectionundefined)  {             cgpoint velocity = [sender velocityinview: Recognizer.view];           &nBsp Bool isverticalgesture = fabs (VELOCITY.Y)  > fabs (velocity.x);             if  (isverticalgesture)  {                 if  (velocity.y >  0)  {                     direction = UIPanGestureRecognizerDirectionDown;                 } else {                      direction = uipangesturerecognizerdirectionup;                 }             }            else {                 if  (velocity.x > 0)  {                      direction = uipangesturerecognizerdirectionright;                 } else {                     direction =  uipangesturerecognizerdirectionleft;                 }            }         }        break;     }    case&nbSp uigesturerecognizerstatechanged: {        switch  (direction)  {            case  uipangesturerecognizerdirectionup: {                 [self handleUpwardsGesture:sender];                 break;             }            case  UIPanGestureRecognizerDirectionDown: {                 [self handleDownwardsGesture:sender];                 break;             } &nBsp;          case uipangesturerecognizerdirectionleft:  {                [self  handleLeftGesture:sender];                 break;            }             case uipangesturerecognizerdirectionright:  {                [self  handleRightGesture:sender];                 break;            }             default: {                 break;             }        }         break;    }    case uigesturerecognizerstateended: {         direction = UIPanGestureRecognizerDirectionUndefined;            break;    }     default:        break;}}

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

[TableView Addpulltorefreshwithactionh

Transferred from: http://www.cocoachina.com/ios/20141231/10783.html

Some Kit Kat tricks developed by iOS

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.