iOS Development---Tips

Source: Internet
Author: User

1.hide the Uitextfield cursor after IOS 7

Usually when we use Uipickerview as our Uitextfield Inputview, we need to hide the cursor. Of course, if you want to change the color of the cursor, it is also handled.

1 textfiled.tintcolor = [Uicolor Clearcolor];

One of the remaining problems with this approach is that when we use Uipickerview as the inputview of Uitextfield, we don't want to perform various menu operations (select all, copying, pasting), but just to set Uitextfield Tintcolor, We can still perform this operation, so we need to add extra processing. This problem, we can deal with: in Textfieldshouldbeginediting:, we put Uitextfield's userinteractionenabled set to No, Then in textfieldshouldendediting:, set this value back. As follows:

-(BOOL) textfieldshouldbeginediting: (Uitextfield *) TextField {    = NO;     return YES;} -(BOOL) textfieldshouldendediting: (Uitextfield *) TextField {    = YES;     return YES;}

iOS Development---Tips

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.