두 개의 회전 장치를 서로 옆에 놓을 때이 문제가 있습니다. 다음은 레이아웃 XML의 단편은 : 여기 서로 옆에 두 개의 회전 장치가 있습니다.
...
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2" >
<Spinner
android:id="@+id/x"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:layout_weight="1" />
<Spinner
android:id="@+id/y"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:layout_weight="1" />
</LinearLayout>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<ListView
android:id="@+id/z"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#FFFFFF" >
</ListView>
...
...
는 결과이다 : 나는 많은 다른 것들을 시도
. 나는 가중치, 중력을 변경하려고 시도했으나 부모를 RelativeLayout으로 변경했지만 결과는 동일하게 유지되었습니다.
도와주세요!
편집 :
확인. 알았다. 약간의 중복성은 문제를 해결합니다. 왜 이상한가 작동하고 "정상적인 방법"하지 않습니다. 모두 도움을 주셔서 감사합니다.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2" >
<Spinner
android:id="@+id/x"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
<RelativeLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1" >
<Spinner
android:id="@+id/y"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
</RelativeLayout>
</LinearLayout>
문제가 재현되지 않습니다. 서로 옆에있는 두 개의 스피너 만 빼내려고 했습니까? 하나의 LinearLayout을 루트로, 두 개의 스피너를 하나씩 사용 했습니까? 또한 이클립스의 미리보기와 실제 장치/에뮬레이터에서이 문제가 발생합니까? –