How to get rid of a gap around the Round Rect button without removing the border around it?

BTW. this may seem like a duplicate of the shadow button issue, but they have a monotonous background, in my case the background is an image, so a simple border does not fix the problem.

When creating an application for iPhone / Pad, I noticed that: UIButton appears with a white space or a line at the bottom if the background is not white.

button

  • Any suggestions?
  • Can't get rid of him?

enter image description here

PS. Jay Wardell got it. Although I did not use the image in the button, changing it to Custom Type and rounding the corners did the trick. TY. Jay, send this as an answer, I will mark it as correct. The one on the left looks perfect. Now I just need to change all of my 100 or so to Custom and round their corners, because Xcode does not correctly crop the Round Rect button.

enter image description here

+2
source share
1 answer

It looks like you had a button type set to UIButtonTypeRoundedRect, which would mean that the button draws a round rectangular THEN background of your custom background image. Change the buttonType button to UIButtonTypeCustom and it should work.

+1
source

Source: https://habr.com/ru/post/902688/


All Articles