Uibutton expands the response area and click to highlight the halo effect

Source: Internet
Author: User
1. Set the highlighted halo effect of the button being clicked Code As follows:
[Cancelbutton Setshowstouchwhenhighlighted : Yes ];

2. Expand the touch response area with the button

the original code is as follows: menubtn. frame = cgrectmake (4, 8, 44, 28);
the code for expanding the touch area is as follows:
[menubtn setimage : [ pyutiles
imagefromfile : @" menubtn.png "]
forstate : uicontrolstatenormal ];
[menubtn setframe : cgrectmake ( 0 ,
0 , 48 ,
44 )];
[menubtn setcontentmode : uiviewcontentmodecenter ];
principle: Expand the frame rect of the button and set the image to center.
Note: If setimage and setbackgroundimage are used, will expand the image to the entire response area

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.