3

通常のスピナーは次のようになります。

ここに画像の説明を入力

選択したアイテムを使用して回転しようとすると android:rotationY="180"、論理的にも回転します

ここに画像の説明を入力

問題は、選択したアイテムが回転して、選択したアイテムのテキストが意味をなさないことです

必要なものは最初の写真と同じですが、スピナーが回転しています

スピナー XML :

<Spinner  
     android:id="@+id/privacySpinner"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_below="@id/eventPrivacy"     
     android:layout_alignParentRight="@id/eventPrivacy"
     android:prompt="@string/event_privacy"
     android:entries="@array/privacy_levels"         
     android:rotationY="180"
/>
4

2 に答える 2

1

ビュー(textView)として呼び出されるため、「選択されたアイテム」を選択して解決し、それを元に戻します。選択されたアイテムは元に戻されます

  privacySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {


                public void onItemSelected(AdapterView<?> adapter, View view, int pos, long id) {

                  if(Locale.getDefault().getLanguage().equals("ar"))
                    view.setRotationY(180);// rotating the view (Selected Item) back 
                public void onNothingSelected(AdapterView<?> arg0) {
                }
            });

        }
于 2013-07-29T12:33:44.243 に答える