objective c - How to create a small button with a large tappable area -


I want to create a close button which will look like a circle with X in the x code I have the size of the button and Width made big so that the touchable area is bigger (50x50 with just 22 fonts).

I create a button, change the title to X and then set the following:

  [self.closeButton.layer setBorderWidth: 2.0f]; [Self. Close button Player setborderroller: [[UIColor whitecolor] CGColor]]; [Self. Close button Player setcorn radius: self. Close button.boundsskies Wth / 2];   

The circle limit is very far away from X. Can I bring the boundaries on the axes to X, but can not reduce the size of the clickable area?

Assign an image to a button and make the tappable area as you want, then above the button, below Set the image's position in the button by setting the button's inset value as left, right. Change its value according to your needs You can set the inset value from the inset builder as shown in the image. Change the price and see the difference to keep your image at the desired exact location.

setting inset

exactly like this image

inset setting with more tappable area

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -