textIsSelectableをtrueに設定すると、テキストはスワイプしなくなりますが、指でスワイプするとタッチします。どうしましたか? textisselectableを有効にした後にテキストをスワイプしたい場合は、ユーザーがclipbordにコピーしてスワイプします。 textIsSelectableをtrueに設定して削除すると、ページが簡単にスワイプされます。何が間違っている?提案された助けをお願いしますか?私はまた、フラグfocusable
、focusableInTouchMode
、clickable
、及びtrue
longClickable
に設定する(true
に)textIsSelectableの値を設定するのでtextIsSelectableを有効にした後、指でスワイプするとテキストがスワイプしなくなる
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginTop="50dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/colorAccent"
android:textSize="25sp"
android:text="my favorite Quotes" />
<ViewFlipper
android:id="@+id/view_flipper"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="6dip"
android:background="#FF312828"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/Jim_Rohn"
android:textColor="#FFC7C7EA"
android:textSize="20sp"
android:textIsSelectable="true"
android:textStyle="bold">
</TextView>
<ImageView
android:layout_marginTop="10dp"
android:layout_width="150dp"
android:layout_height="150dp"
android:src="@drawable/jimrohn" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/ludwig_wittgenstein"
android:textColor="#FFC7C7EA"
android:textSize="20sp"
android:textIsSelectable="true"
android:textStyle="bold">
</TextView>
<ImageView
android:layout_marginTop="10dp"
android:layout_width="150dp"
android:layout_height="150dp"
android:src="@drawable/ludwigwittgenstein" />
</LinearLayout>
およびJava
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
menu.add(0, v.getId(), 0, "Favorite Quotes");
TextView textView = (TextView) v;
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setText(textView.getText());
super.onCreateContextMenu(menu, v, menuInfo);
}
あなたの種類のお返事ありがとうございますishmaelMakitlaしかし、それはあなたが私をさらに助けることができない場合は助けになりませんでした。 –
'v.focusableInTouchMode(false);と' v.focusable(false); 'を追加してみてください - これが役立つことを教えてください。 – ishmaelMakitla
私vieflipperをアニメーションから制御されている< アンドロイドを設定:shareInterpolator = "偽"> <翻訳パブリックブールonTouchEvent(MotionEventタッチイベント){ スイッチ(touchevent.getAction()){ユーザーが最初に交換する画面をタッチ // ケースMotionEvent.ACTION_DOWN:{ lastX = touchevent.getX(); 休憩。 }アンドロイド:fromXDelta = " - 100%" アンドロイド:toXDelta = "0%" アンドロイド:fromYDelta = "0%" アンドロイド:toYDelta = "0%" アンドロイド:持続時間= "500" /> –