I add a UITextField to a UITableViewCell as a AccessoryView. I'd like a clear button at the end of the textfield. Now it looks like this:
http://twitpic.com/43mzwu
I think the clear button doesn't look good. I think it should be more on the right site. But now I found no solution to get the button more on the right side. Do you have any solution for my problem.
(Sorry for my bad english, I'm no native.)
Subclass UITextfield and implement clearButtonRectForBounds:. You can refer to the iOS Reference Library for more details on UITextFields.
Related
I am newbie in iOS. Sorry for my English. Actually I want a button at the bottom of my JSQMessagesCollectionViewenter image description here. I have tried to put it like "drag" and "drop". But it doesn't work there. I know there must be a silly mistake which I am doing with the logic. But I need someone's help to guide me the correct way to do it. Thanks in advance. :)
JSQMessagesCollectionViewController was deprecated I would suggest you to replace it with something else as soon as you can. MessageKit for example.
THis is out side the scope of the JSQ library. I guess it could be in the scope of the library depending on what the button does but JSQ really only helps when it comes to chat. So if the CollectionView you have displayed is the chat part of your app you could add a button in the inputBar but the screen shot does not seem to indicate that. Other wise what you are doing should be pretty strait forward. You could add a button via StoryBoard add Constraints to pin it to the bottom of your screen and hook up the outlets for it to do the action you desire. Or you could do it programmatically in your ViewController. That is about all the help that can be provided with the information given. If share more of you code we may be able to provide more guidance.
Daniel is saying right this is out of the scope of the jsq library still if you want to add Button or other view i will suggest you to add it programmatically to your JSQMessagesViewController SubClass like if i am understanding your question you can add view above the JSQMessagesViewController's Subclass's inputToolBar as -
UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, self.inputToolbar.frame.origin.y - self.inputToolbar.frame.size.height, self.view.frame.size.width, 55)];
v.backgroundColor = [UIColor redColor];
[self.view addSubview:v];
now then you have to change the position of view / button each time keyboard appear or disappear as inputbar becomes first responder. As far as i am understanding your question i think this will help.
Although You can also change the XIB of InputToolBar and Can customize your Button in storyboard(xib) then do changes in the class of InputToolBar according to your needs.
In my Purpose, I want to custom keyboard by adding textfield on the keyboard look like Facebook app on iOS. when you tap on comment button it will appear the keyboard on also have textfield above that.
Do you have any keyword or solution on that problem?. I am youngest with swift and write in native language. If you do not clear with my question please comment.
Thank in advance
I'm not sure if I understood your question, but it seems like you want a textfield just above the keyboard. For that you can add a TextField on the bottom of a view and make it move accordingly whenever the keyboard appears. Check this out: Move textfield when keyboard appears swift
I'm trying to recreate the function of the clear button in UITextFields but with a UIButton and as such have a UIButton as a subview of another UIButton. I read somewhere that I need to have the superview handle the touch events of the subview.
The post that hinted at that was outdated and in obj-C so I'm looking for modern and swift version.
Placing a button on another button is a kind of bad implementation in spite of any requirements.
Hope you find out a right way to solve this problem.
Or you can just use a combination of enabling or disabling buttons according to the situation.
profilename1 commented on profilename2.
My output should above like this.
I used UILabel.
My query is profilename1 and profilename2 are in greencolor and must be clickable.
When user click profilename1 after profileviewcontroller loading.I used storyboard.
Uilabel placed in custom table cell.
How should implement this in my app ? Is it possible ?
Source : In instragram when user click on username/profilename in blue color same behavior I will implement.
Thanks.
You could use NSAttributedString but assuming you'd rather an easier more personalized solution you could try using: TTTAttributedLabel. I've seen it used on multiple occasions for pretty much this exact purpose.
I have tried to use
var b = button1.getText() to get the text of a button in limejs but it does not seem to work. Can anyone help?
A Glossy Button does not have a getText method as is, but you could alter the library and create it if that's what you need. I'm not sure why you would want to get the text of a button however, it seems trivial to me as it's mostly hard coded. What you could also do is set a listener to the button which then in turn sets a variable to the text you initially placed in the button.
Please take a look at the documentation of LimeJS before asking questions like this, you could easily have spotted the problem :)