2016-04-26 7 views
0

Register.xmlファイル、私はこのコードを使用している場合robotiumでスピナーを使用するには?

<RelativeLayout 
    android:id="@+id/spinner_relay" 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 
    android:layout_below="@id/fd_register_header" 
    android:layout_marginBottom="@dimen/dm_5dp" 
    android:layout_marginLeft="@dimen/dm_10dp" 
    android:layout_marginRight="@dimen/dm_10dp" 
    android:layout_marginTop="@dimen/dm_5dp" 
    android:background="@drawable/spinner_background" > 

    <TextView 
     android:id="@+id/fp_spinner" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_centerVertical="true" 
     android:drawablePadding="@dimen/dm_10dp" 
     android:drawableRight="@drawable/icondown" 
     android:gravity="left|center" 
     android:padding="@dimen/dm_10dp" 
     android:text="Select city" 
     android:textColor="@color/white" 
     android:textSize="@dimen/dm_18sp" /> 
</RelativeLayout> 

int pos = solo.getCurrentSpinners().get(0).getSelectedItemPosition(); 

取得エラー、

シンボルgetCurrentSpinnerを解決することはできません

+2

を働きました。 –

+0

Soloクラスに 'getCurrentSpinners'というメソッドはありません。 isSpinnerTextSelectedメソッドを使用することができます – Pehlaj

答えて

1

使用して次のことを試してみてくださいスピナーと協力するためのコードです何があなたの完全なコードを示してください、私のため

solo.pressSpinnerItem(0, -5);  //selects the item in the spinner 

それとも

solo.isSpinnerTextSelected(0,"Items") //checks whether the spinner item is selected 
関連する問題