2016-05-21 10 views
0

textIsSelectableをtrueに設定すると、テキストはスワイプしなくなりますが、指でスワイプするとタッチします。どうしましたか? textisselectableを有効にした後にテキストをスワイプしたい場合は、ユーザーがclipbordにコピーしてスワイプします。 textIsSelectableをtrueに設定して削除すると、ページが簡単にスワイプされます。何が間違っている?提案された助けをお願いしますか?私はまた、フラグfocusablefocusableInTouchModeclickable、及びtruelongClickableに設定する(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); 
} 

答えて

0

感謝されます。したがって、あなたの場合は、これらの他のフラグをデフォルト値または以前に設定した値に手動で再設定する必要があります。私の提案は、すべての値をfalseに設定することです。 だから、このコードでできます

... 
TextView textView = (TextView) v; 
v.setClickable(false); 
v.setLongClickable(false); 

私は、これは私にそれが行く方法を知ってみましょう、役立ちます願っています。

+0

あなたの種類のお返事ありがとうございますishmaelMakitlaしかし、それはあなたが私をさらに助けることができない場合は助けになりませんでした。 –

+0

'v.focusableInTouchMode(false);と' v.focusable(false); 'を追加してみてください - これが役立つことを教えてください。 – ishmaelMakitla

+0

私vieflipperをアニメーションから制御されている< アンドロイドを設定:shareInterpolator = "偽"> <翻訳パブリックブールonTouchEvent(MotionEventタッチイベント){ スイッチ(touchevent.getAction()){ユーザーが最初に交換する画面をタッチ // ケースMotionEvent.ACTION_DOWN:{ lastX = touchevent.getX(); 休憩。 }アンドロイド:fromXDelta = " - 100%" アンドロイド:toXDelta = "0%" アンドロイド:fromYDelta = "0%" アンドロイド:toYDelta = "0%" アンドロイド:持続時間= "500" /> –

関連する問題