Vì vậy, tôi có các bộ tản nhiệt sau đây. Tôi muốn có chúng hiển thị như thế này:Có bọc RadioButton ngang nếu quá dài cho màn hình
Tuy nhiên điều này xảy ra:
Làm thế nào tôi có thể lấy nó để hiển thị như trên?
Tôi có thể di chuyển trong trình soạn thảo GUI trong Eclipse nhưng nó loại bỏ RadioButton khỏi RadioGroup!
Trong nhóm, nó bỏ qua tất cả các thông số bố cục khác.
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/timeBar"
android:layout_marginTop="43dp"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/privRadio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Everyone" />
<RadioButton
android:id="@+id/privRadio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="FriendOfFriends" />
<RadioButton
android:id="@+id/privRadio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Friends" />
</RadioGroup>
Thú vị, là nó có thể sử dụng điều này bên trong một RadioGroup? – TheRealKingK
Tôi tin là không, nhưng có thể sử dụng RadioButton mà không gán chúng cho một nhóm. –
@ TheRealKingK: Nếu bạn sub-class một RadioGroup và thực hiện các hàm onMeasure() và onLayout() tương tự như FlowLayout, bạn sẽ nhận được giải pháp mà bạn đang tìm kiếm. Xem giải pháp của tôi trên trang này. –