2012-12-17 5 views
6

나는 스피너에서 텍스트를 오른쪽으로 맞추기 위해 노력하고 있습니다. 그러나 그것을하지 않을 때마다 Gravity를 오른쪽으로 설정하려고했거나 끝을 줄이려고 시도했지만 아무것도 작동하지 않습니다.안드로이드 회 전자 중력 작동하지 않습니다

enter image description here

이 문제를 도와주세요 수 있습니다 내가 가진 모든이가?

고마워요.

다음은 XML이다 :

<RelativeLayout 
android:layout_width="match_parent" 
android:layout_height="40dp" 
android:orientation="horizontal" > 

<org.holoeverywhere.widget.Spinner 
    android:id="@+id/spnCities" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_centerVertical="true" 
    android:layout_marginRight="10dp" 
    android:entries="@array/array_cities" 
    android:gravity="right"/> 

<TextView 
    android:id="@+id/tvCities" 
    android:layout_width="70dp" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_centerVertical="true" 
    android:layout_marginLeft="10dp" 
    android:text="@string/city" 
    android:textAppearance="?android:attr/textAppearanceSmall" /> 

+0

당신이 당신의 XML을 게시 할 수 있을까요? – Silverstorm

+0

@Silverstorm 예, 편집을 참조하십시오. 덕분에 – Houssem

+1

시도해보십시오. http://stackoverflow.com/questions/2491980/how-to-color-and-alignment-spinner-item-on-android – Silverstorm

답변

1

당신은 아마 작동이 가능하도록 사용자 지정보기를 사용해야합니다. 이것은 아마도 도움이 될 것입니다 ... 그 당신의 가장 친한 친구를 구글 사용

Align spinner values to right instead of left

+0

Spinner 폭 wrap_content를 사용하는 것처럼 보이지만 작동하지 않습니다. weight, dp length 또는 match_parent와 함께 작동하며, –

관련 문제