Pankaj Kainthla
Pankaj Kainthla

Reputation: 2489

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

how can i make a button such that user only see the text on it but not the button in iphone sdk ? i tried to lower its alpha value but even then it appears a little

Upvotes: 0

Views: 104

Answers (4)

Sarabjit Singh
Sarabjit Singh

Reputation: 1824

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

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

Upvotes: 0

hotpaw2
hotpaw2

Reputation: 70733

Create your button of type UIButtonTypeCustom and add:

[myButton setBackgroundColor: [UIColor clearColor]];

Upvotes: 1

rano
rano

Reputation: 5666

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?

Upvotes: 1

skorulis
skorulis

Reputation: 4381

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

Upvotes: 1

Related Questions