我不明白为什么,但实际设备(运行时)中 textView 中的文本与我的布局预览的大小不同。
这是我的文本视图 XML 文件的片段:
<TextView
android:id="@+id/tournament_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TOURNAMENTS"
android:layout_marginTop="8dp"
android:layout_gravity="center"
android:textColor="#CDDC39"
android:textStyle="bold"
tools:textSize="40sp"/>
使用app
而不是tools
在tools:textSize
工具用于设计时功能,例如在片段中显示哪种布局)或编译时行为,例如将哪种收缩模式应用于您的 XML 资源
查看更多详细信息:https : //developer.android.com/studio/write/tool-attributes.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句