开发者

how can i make a button such that user only see the text on it but not the button iphone sdk

开发者 https://www.devze.com 2023-01-13 09:22 出处:网络
how can i make a button such that user only see the text on it but not the button in iphone sdk ? i tried t开发者_如何学Co lower its alpha value but even then it appears a little If you just don\'t wa

how can i make a button such that user only see the text on it but not the button in iphone sdk ? i tried t开发者_如何学Co lower its alpha value but even then it appears a little


If you just don't want to see the rounded rectangle of the button then set the button type to custom.


You can follow this workaround by using a UILabel instead of a UIButton. This does not answer directly to your question, as setting a custom type should and since it does not can you post some code?


Create your button of type UIButtonTypeCustom and add:

[myButton setBackgroundColor: [UIColor clearColor]];


You must use a custom button......

UIButton *custBtn = [UIButton buttonWithType:UIButtonTypeCusttom];
[custBtn setText:@"Sarabjit" forState:UIControlStateNormal];
[self.view addSubView:custBtn];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号