我正在尝试将spinner/progress bar
添加到TextView
的左侧。将微调器/进度条添加到文本视图中?
________________
| O MY TEXT |
|________________|
O = spinner/progress bar
起初,我想到的是增加一个TextView
,并在其顶部添加ProgressBar
。是否有可能在TextView
本身做到这一点?如果不是这样做的最好方法是什么?
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/latlongLocation"
android:layout_width="150dp"
android:layout_height="23dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="21dp"
android:background="@drawable/black"
android:gravity="center"
android:singleLine="true"
android:textColor="#202020"
android:textSize="11sp" />
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</RelativeLayout>
有你为什么在你的布局硬编码保证金和部件尺寸特殊的原因?您可以使用样式/维度资源来保持应用程序的一致性。关于文本颜色或绘图也是如此。 – 2Dee
@ 2Dee我是Android SDK的新手,谨慎帮助我纠正我的代码? –