There's a shadow on my button

前端 未结 3 1124
既然无缘
既然无缘 2021-01-05 11:10

i\'m creating a button programmaticly for an iPad application. when i see the button, there looks to be a shadow type thing below it. what is it and how can i get rid of it?

3条回答
  •  孤街浪徒
    2021-01-05 11:33

    This question is old (6 months) but i'have found a solution to delete/mask this bad effect of double lines.

    [yourButton.layer setBackgroundColor: [[UIColor blackColor]CGColor]];
    [yourButton.layer setBorderWidth:1.0f];
    [yourButton.layer setBorderColor:[[UIColor blackColor]CGColor]];
    [yourButton.layer setShadowOpacity:0.1f];
    [yourButton.layer setCornerRadius:10];
    

    UIColor selected is depending of the current background of your view.

    Result : enter image description here

提交回复
热议问题