2
다소 지루한 질문에 대해 미안하지만, "action bar"에 버튼을 배치하려하고 "layout_alignRight"등을 사용하는 데 문제가 있습니다. 달성하고자하는 것은 다음과 같습니다.안드로이드 액션 바 버튼 배열
| [button1] _ _ _ 빈 공간 _ _ _ [button2] [button3] [button4] |
나는 네 개의 버튼이 앉아 있어야 어디 RelativeLayout의이 둘러싸고 있고, 나는 아무 소용이 다음과 같은 코드를 시도했다 :<RelativeLayout android:id="@+id/actionBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#666666" >
<Button android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignLeft="@id/actionBar"
android:background="@drawable/buttonImg" />
<Button android:id="@+id/button4"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignRight="@id/actionBar"
android:background="@drawable/buttonImg" />
<Button android:id="@+id/button3"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toLeftOf="@id/button2"
android:background="@drawable/buttonImg" />
<Button android:id="@+id/button2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toLeftOf="@id/button3"
android:background="@drawable/buttonImg" />
</RelativeLayout>
버튼은 항상 길 밖으로 뻗어 얻을 것을, 또는 모두에 쌓여 얻을 위로 서로 위로. 누구든지 찾고있는 간격을 달성하는 방법을 알고 있습니까?
감사합니다 !!! 단지 상대 레이아웃을 사용하여
너무 감사합니다! 나는 그 구성을 이미 시도 했었다고 맹세 할 수 있었다. .. 고마워. – TomBomb
당신을 진심으로 환영합니다. 상대 레이아웃은 스프링 레이아웃만큼이나 복잡하여 쉽게 잃어 버릴 수 있습니다. –