【发布时间】:2017-09-28 15:23:54
【问题描述】:
我正在使用来自https://github.com/Kaopiz/android-segmented-control 的分段控制,它工作得很好,除了最后一个按钮总是像这样被挤压:
我正在使用简单布局动态添加 RadioButtons:
<RadioButton xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/RadioButton" />
我尝试了 Layout_width="wrap content" 和删除 "layout_weight" 等变体 - 结果相同。 分段控件本身的父布局也没有给出任何提示:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@color/white"
android:gravity="center"
android:minHeight="60dp">
<info.hoang8f.android.segmented.SegmentedGroup
android:id="@+id/segmentedGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
segmentedgroup:sc_border_width="1dp"
segmentedgroup:sc_corner_radius="10dp"
segmentedgroup:sc_tint_color="#FFEB3B">
</info.hoang8f.android.segmented.SegmentedGroup>
</RelativeLayout>
【问题讨论】:
标签: android radio-group android-radiogroup segmentedcontrol