How to Display Underlined Text in a Button : iphone [duplicate] - iphone

This question already has answers here:
Underlining text in UIButton
(18 answers)
Closed 9 years ago.
I want to display the mail ID in my view such that clicking the mail ID should open the mail composer view.
I want to display the button text as underlined to show it is a hyperlink and for the button click event to call the mail composer view. At present, I am not able to show the button text underlined.

You can use UILabel to implement this Tack look at TTTAttributedLabel for display underline label. And add TapGestureRecognizer to label and in that TapGestureRecognizer method implement code to show MailComposer.

Related

Clickable Link in Editable TextView ios 6 [duplicate]

This question already has answers here:
How to make UITextView detect links for website, mail and phone number
(8 answers)
Closed 9 years ago.
I set the editable property of UITextView yes as I need the UITextView editable then in that case How could be possible to click the link in UITextView ? Is there anyway to fix out my problem
You have to set detect type of UITextView in implementation file like
textview.editable = NO;
textview.dataDetectorTypes = UIDataDetectorTypeAll;

change image on click of UIButton in objective c [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
change image on click of button in objective c
i draged 3 button in my .xib file and initially i given default image to them using property window as first.png.
i don't know name of my buttons, because i created button by dragging, i want to know what will be the name of my button ?
now when user clicks on firstButton, image of button should change from first.png to second.png..
and when user selects on 2nd button, image of button2 should change from first.png to second.png, and also change image of 1st button to default again first.png, so that user came to know he has clicked 2nd button.
in short i want to implement like radio button.
how should i do this ?
Thanks In Advance !!
There are multiple ways in which you can do this..
here are a couple of those..
You can give name to these buttons using IBOutlets and determine which button sent the message.
You can determine by tag on buttons which can be edited on the xib itself and you can determine which button sent the message using the tag properties..
As Ankit explian you this can done in multi ways
I suppose you have created two button add_btn, requestBtn with Interface Builder.
Now you need to set the connection (Event, outlet) for both button.
I think you have knowledge so, I will not explain here how to set button (control) connection (Event, outlet) via inteface builder.
For example: add_btn connected to AddFriends methods and requestBtn with getFriendRequest.
Now you can change the Image of Button As
#pragma mark change Image of first Button
-(void)AddFriends:(UIButton*)sender{
[add_btn setImage:[UIImage imageNamed:#"Cliked1.png"] forState:UIControlStateNormal];
[requestBtn setImage:[UIImage imageNamed:#"unCliked2.png"] forState:UIControlStateNormal];
}
#pragma mark change Image of second Button
-(void)getFriendRequest:(UIButton*)sender{
[add_btn setImage:[UIImage imageNamed:#"unCliked1.png"] forState:UIControlStateNormal];
[requestBtn setImage:[UIImage imageNamed:#"Cliked2.png"] forState:UIControlStateNormal];
}
I hope it will help you

How to display the textfield when click on the button [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
How to add UITextfield on click of UIButton and make it editable
I want to display the UITextField which becomes editable when click on a button.
if any one knows please give me the answer.
Create an IBAction for the UIButton like this:
-(IBAction)showTextFied:(id)sender{
yourTextField.editable=YES;//turn to editable mode if it's not
[yourTextField becomeFirstReponder];//show the keyboard
}

iPhone SDK, UIButton on UITableView, delete row if button was pressed [duplicate]

This question already has answers here:
Detecting which UIButton was pressed in a UITableView
(26 answers)
Closed 2 years ago.
I am new in iPhone development and now I have simple question(may be not simple:). I have a UITableView, and in that UITableView I have for example 5 rows, every row has a UILabel and UIButton.
What I want to do is to delete one element from the array when my button is pressed. Button I create with tag, but that doesn't work. I do not want use didSelectRow; I want to delete an element from the array only if my button was pressed. (For example, if the third button was pressed I want to delete the third element of the array. Using the standard delete button does not work for me.
If you have a custom UIViewController to manage each cell (which I highly recommend), simply wire up the button to an IBAction and have that method remove the item from whatever data structure supplies the UITableView with rows, and then tell the UITableView about it.
Failing that, I suppose you could attach a tag to each button, indicating which row it belongs to, and wire them all up to a single IBAction in your table-view controller.

how to change colour of arrow in uitableview [duplicate]

This question already has answers here:
Which is the best way to change the color/view of disclosure indicator accessory view in a table view cell in iOS?
(12 answers)
Closed 8 years ago.
I want that the arrow of Tablecell is visible permanently. currently it is visible only on selection.
secondly i want to change its colour from white to orrange.
How i will do this.
Regards
Nauman k
You can find your answer here:
Which is the best way to change the color/view of disclosure indicator accessory view in a table view cell in iOS?