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 :)
Related
Yo!
I have created a design in the Main.storyboard.
I have a lot of views that I'm using to slideIn/slideOut etc.
The problem is that one of those views have some textfields. None of them responds on click. If I want to interact with them, I have to call 'becomesFirstResponder', but still, the other textfields are not able to respond on click.
I've tried a lot with "bringSubViewToFront" etc, but nothing seems to work. I don't know how to make those TextFields able to interact with.
They're all set delegate, enabled, and all of that.
tv1.delegate=self
tv2.delegate=self
tv3.delegate=self
tv4.delegate=self
What else can I try?
RIGHT, FINALLY!
I do NOT recommend this shitty solution.
But, if you suffer a problem similar to mine, just get it to work with this solution:
Add button for ALL of your textFields. Place them where your UITextFields are located and make the Buttons transparent in Attribute-inspector.
Add Action to the buttons in your ViewController-class and name them something "textField1_isEditing".
Inside the code-brackets, place following: yourTextFieldsName.becomesFirstResonder()
DONE! Now you can use a TextField that don't respond on buttonClicks, even if you have 100% sure set "userInteractionEnabled" "enabled" etc..
I have a custom class here that consists of a UIButton inside of a UIView.
The goal of this class is to allow users to have a greater area (being the UIView) to select the button than just the buttons frame itself.
Now when a user taps on the view I want the buttons highlighted image to show... But the problem is, it does not.
I've read many possible solutions to this issue For Example:
Calling: [btnObject sendActionsForControlEvents:UIControlEventTouchUpInside]
This however did not change the buttons highlight.
I also tried just settings the button.highlighted = YES;
But that did not work either.
I have the images for different states properly setup (Normal and Highlighted), I'm sure of that.
I also have the gestureRecognizer working properly as the functionality is great except for the lack of highlight.
Does anybody know if I'm missing any thing special that needs to be done in order to pull off this seemingly very simple task? Surely it's been done many times.
Thank you
You were on the right track. -[UIButton setHighlighted:] is just a flag. What you need to do is call setNeedsDisplay on that button right after you change the highlighted property.
I solved my problem a little while ago and I'm not sure if Kevin Low's answer would've worked too, it very well might have.
But for some reason, a UITapGesture doesn't work well with highlighting buttons as a view transitions (That might be because I didn't call setNeedsDisplay). The gesture that ended up working was the UILongPressGesture with a 0.0 sec for minimum duration.
I don't know if this is applicable in iphone. I'm trying to add button inside label text. See image below.
If you see there is href or anchor(web name) inside the square that I'm pointing. Can I put button inside the text? These data came from rest api. I need an advice if this applicable or possible to do that. If ever this is applicable please give me idea on how to do that.
Thanks in advance
I think what you want is actually add user interaction to certain range of the string, right?
This can be easily achieved by this library TTTAttributedLabel
Please take a look at it and then you can dynamically set what you want to link.
i am in need to use a text field in my application but the ones provided by XCode are only 1 line long and you can only change the width but not the hight.
I was wondering if its possible to make it look more lines long?
Is it only possible with customization and if yes any good tutorials?
Thank you!
First off, you can actually change the height of a UITextField. Just change the border style in the Attributes Inspector to anything except the default "rounded corners". You can then resize it right in Interface Builder. If you really wanted to, you could even change it back in your viewDidLoad method like this:
self.myTextField.borderStyle = UITextBorderStyleRoundedRect;
However, to have multiple lines, you have to use a UITextView. It's by default multi-line, but see the Apple documentation for more information.
You can use a UITextView. The document about it here. If you need something else, please post an image of what you want to achieve.
I have to create custom keyboard like the real keyboard in iOS.
I need to do following like keyboard.
like that.
How can i create like that?
Please tell me , because i'm just new beginner.
Here's something that I created that might help. Just fork it on GitHub and change the Punjabi characters to Myanmar. Most of the hard work is done for you :)
https://github.com/kulpreetchilana/Custom-iOS-Keyboards
With a custom view and custom buttons. The keyboard itself is something very easy to do, you just need to place some buttons on a view and then show that view.
Your real problem will be connecting the button actions to the text field.
You would have to check for the first responder and then add to its text the value corresponding to your custom keyboard. It will be an even more difficult problem to actually "type" those weird characters from the keyboard in the text field. I am not familiar with them, are those real ASCII characters?
Anyway, you're in for quite some work. It's not something very difficult to code, requiring some complicate algorithms, but the implementation will be tricky and complex, so be careful