UIMenuController not showing UIPasteBoard is cleared iPhone app? - iphone

Am working in message based iPhone application. In my application looking like iMessage native iOS app. I made Bubbles with used UIImageView and UILabel. I made UILabel as clickable and showing Copy option. It is working fine when the message input UITextView is not in active.
1. I can show the "Copy" option when we clicking UILabel and the UITextView is not becomeFirstResponder.
2. When the user clicking the MessageTextView (UITextView) from the bottom of the screen the UITextView becoming first responder and keyboard is showing now. In this scenario if the user clicking the messabe bubble (UILabel) the UIMenuItem showing "Paste" on the bubble instead of "Copy".
3. If i click "Paste" from the bubble UIMenuItem already copied text will be pasting in UITextView. So the control fully in UITextView UIMenuController not activated in UILabel. So i cleared the text from UIPateBoard when the user clicking the Bubble (UILabel).
4. Now the UIMenuController not showing up even [self becomeFirstResponder]; not becoming in UILabel class.
The reason is when the UITextView is in becomeFirstResponder the control fully in that. not coming to UILabel. Could you please help me on this.
How to show UIMenuItem "Copy" when the user clicking UILabel if the keyboard is in visible the control is in UITextView? Could you please help me on this. I spent two days in this issue. Thanks in advance.

May be I am wrong.CONSIDER THIS ANSWER AS A COMMENT.
I tried to achieve like what you are trying to do. Thats not working too. I figured out I cannot make access the two views at the same time. Especially when I have any view becomeFirstResponder and you cannot access menu items of other view.
But if you try like this,you may succeed in your code.
1) In the touchesBegan: method, find the user touching inside your UILabel.
2) If that happens, then show a custom view with buttons like copy,paste and select like that.

Related

Prevent UIKeyboard from showing on UISearchBar tap

I have my own custom keyboard in a uiview which i'm adding to the UIWindow in certain situations.
I switch between standard UIKeyboard and my custom keyboard with a button.
Problem: when i have my custom keyboard already shown on screen and i tap the UISearchBar i get the standard UIkeyboard shown above mine.
What I expect is to supress showing of Sandard UIKeyboard when i have my custom one already showing on screen.
I intercept keyboardwillshow event but it seems at this event is too late to do that.
I also tried subclassing UISearchBar and get control over its UITextField to get the Shouldbegintextediting but it doesn't seem to work ... (FYI UISearchBar doesn't have shouldbegintextediting event in the protocol. Its only for uitextfiled).
Also, there is no such thing as 'inputView' property in UISearchBar.
I tested this on iOS 5.1.
Anyone with experience on this kind of issue?
Thank you.
Set the inputView of the search field to your custom keyboard.

UISearchbar: Diplaying last inputs

I have a UISearchbar in my application and would like to have a popover when typing text that shows me the last search-inputs. Do I have to implement this by myself, or is this included in the UISearchbar and needs to be activated?
You will need to implement this yourself

UIView accessibility issue

I've developed an iPhone App and most of it is accessible but I have an issue with one thing I do.
When the user clicks the settings button in the App (it has a main menu with a bunch of buttons for various Applications) I add a UIView on the top and and darken the background screen. Unfortunately for a blind person this UIView doesn't become "active", ie they are still navigating around the background screen.
I initially added the UIView using addSubview: and then tried insertSubview: atIndex: but neither have operated as expected.
Edit: Further information there are text fields and a button on this screen, perhaps I could instead make one of them active or something?? No idea how I would do this though.
How about using becomeFirstResponder? It makes the control receiving this message active and the receiver of input. For UITextView etc. it brings up the keyboard.
I didn't get what you are saying, but I thought there may be problem with the view added on the top.
Do one thing, if you added the view using interface builder then select the view and click on Layout menu in the Menu bar and select "Send to Back".
or else if you add that through code, then write code as
[self.view sendSubViewToBack:addedView];
Regards,
Satya

can I put a scrollable text field on a uialertview?

I am needing to alert something for an answer for a trivia game iOS app I am writing. I have an alert view that pops up and shows a scrollable uitextview...is Apple going to ding me for that? What are my options for showing large amounts of text in my alert?
Thanks!!
I think that showing UITextView is ok. Moreover it seems that Apple actually does the same thing - if you try to display very long text in UIAlertView then it will be displayed in scrollable UITextView automatically
P.S. and it also uses UITableView instead of buttons if you set too many button names.

Remove keyboard or place Picker View on TOP of keyboard

Anyone has any idea how one can achieve the same look as when you press on the "From:" in the Mail iphone app when you have more than one user account.
I'd like to remove my keyboard, but WITHOUT animating it. Rather just disappear and instead of it have a UIPickerView appear.
Thanks much!
Since iOS 3.2 you can set the inputView property of a UITextField to a custom view. This view is then shown instead of the keyboard as input for that view.
There's no way to achieve this before iOS 3.2 I know.
UITextField Class Reference