2016-04-26 16 views
0

の背後にあるものを使用することはできません。2つのビューでは、私は2つのビュー持つ他の

  1. のImageButtonを同じ寸法とお互いの岩下積層され
  2. AutoCompleteTextView

相対ビューで表示します。既定では、AutoCompleteTextViewは無効です。設定をクリックすると、AutoCompleteTextViewが有効になり、ImageButtonが無効になります。しかし、どちらの状態でも、ImageButtonを有効にし、もう一方を無効にしても、ImageButtonを決してクリックすることはできません。どうしてこれなの?

私は私はあなたがのImageButtonを無効にすることで何を意味わからない.setEnabled()

  <RelativeLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="15dp"> 

       <ImageButton 
        android:id="@+id/pp_note_1" 
        android:layout_width="150dp" 
        android:layout_height="50dp" 
        android:layout_alignParentRight="true" 
        android:background="@android:color/white"/> 

       <AutoCompleteTextView 
        android:enabled="false" 
        android:id="@+id/pp_autonote_1" 
        android:layout_alignParentRight="true" 
        android:layout_width="150dp" 
        android:layout_height="50dp" /> 

      </RelativeLayout> 

答えて

0

を使用しています。 特定のケースで作業するように思えます。

android:visibility = "gone"をプログラムで使用してみませんか? imageview.setVisibility(View.GONE);

+0

正確には、私は一度に作業し、もう一人は表示しないことを望みます。可視性は私のためにこれを行うでしょうか? – Brejuro

+0

imageview.setVisibility(View.GONE)を作成すると、それはユーザーには表示されないので、ユーザーがAutoCompleteTextViewをクリックすると、そのアクションが実行されます。あなたの要件に応じて1つを見えるようにし、他のGONEを試してみてください。 –

関連する問題