3

メッセージベースの iPhone アプリケーションで作業しています。私のアプリケーションでは、iMessage ネイティブ iOS アプリのように見えます。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.

その理由は、UITextView が becomeFirstResponder に完全にコントロールされている場合です。UILabel には来ません。これについて私を助けてください。

How to show UIMenuItem "Copy" when the user clicking UILabel if the keyboard is in visible the control is in UITextView?これについて私を助けてください。この問題に 2 日間を費やしました。前もって感謝します。

ここに画像の説明を入力

4

1 に答える 1

0

私が間違っているかもしれません。この回答をコメントとして考えてください。

私はあなたがやろうとしていることのように達成しようとしました。それも機能していません。two views同時にアクセスできないことがわかりました。特に、ビューbecomeFirstResponderyou cannot access menu items of other view.

しかし、このように試してみると、コードで成功する可能性があります。

1)touchesBegan:メソッドで、ユーザーが UILabel 内で触れているのを見つけます。

2) その場合は、そのようなボタンを含むカスタム ビューを表示しますcopy,paste and select

于 2012-10-22T09:44:58.083 に答える