我认为这是不可能的,但是静态(确定的)水平进度条可以嵌入到 Textview 中吗?
Update1:我正在尝试创建一个类似于iPhone的进度条,但我还需要它上面的文本。
这是一张图片:https://i.stack.imgur.com/aDFU9.png https://i.stack.imgur.com/aDFU9.png
Update2:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<ProgressBar
style="@android:style/Widget.ProgressBar.Horizontal"
android:id="@+id/pbar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:max="100"
android:progress="45"
android:maxHeight="5sp"
android:layout_marginRight="5dp" />
</LinearLayout>
这是图片:https://i.stack.imgur.com/ypimG.png https://i.stack.imgur.com/ypimG.png
现在我的目标是让它看起来像上一张图片。
As TextView http://developer.android.com/reference/android/widget/TextView.html不能包含另一个视图(没有 addChild() 方法),答案是否定的。
更新:看完图片后,您应该使用包含 TextView 和 ProgressBar 的 LinearLayout。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)