我想实现类似的UI,如图所示。我有点均匀分布,但如何在平均分布下添加图像。 enter image description here
github.com/woxingxiao/BubbleSeekBar
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.xw.repo.BubbleSeekBar
android:id="@+id/bubbleSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:bsb_auto_adjust_section_mark="true"
app:bsb_bubble_color="@color/colorVitalRed"
app:bsb_bubble_text_color="@color/colorWhite"
app:bsb_max="10"
app:bsb_min="0"
app:bsb_progress="0"
app:bsb_second_track_color="@color/blue"
app:bsb_section_count="10"
app:bsb_section_text_position="below_section_mark"
app:bsb_show_progress_in_float="false"
app:bsb_show_section_mark="true"
app:bsb_show_section_text="true"
app:bsb_show_thumb_text="false"
app:bsb_track_color="@color/colorWhite" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_pain_0_emoticon" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_pain_0_emoticon" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_pain_0_emoticon" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_pain_0_emoticon" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/ic_pain_0_emoticon" />
</LinearLayout>
</LinearLayout>
答案 0 :(得分:1)
查看
public class Matching {
public static int match = (int) Math.floor(Math.random()*cities.size()); //Error is here
}
注意: 请使用我的图片和颜色资源更改您的图片资源