我正在尝试新事物(嗯,对于xml和android来说,我也是新事物)。这件事在我头脑风暴期间浮现在脑海。是否可以为元素的值引用XML元素属性?(对不起,英语不太好)
想法:
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/textView1"
android:layout_below="@+id/textView3"
android:layout_marginLeft="15dp"
android:layout_marginTop="12dp"
android:layout_toRightOf="@+id/textView4"
android:max="9"
android:progress="0" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView5"
android:layout_toRightOf="@+id/seekBar1"
**android:text="@id/seekBar1/progress"**
android:textAppearance="?android:attr/textAppearanceSmall" />
突出显示的部分。感谢您的阅读和可能的答案
简单的回答:不,不幸的是,不是。
即使有效,也存在两个其他问题:
看来您希望进度TextView
会更新SeekBar
,即使参考有效,也无法使用。
系统必须自动将进度(浮点数)转换为String。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句