请问我的 textView 大小有问题
我有.xml代码,其中我使用线性/水平/框架布局,并且在布局中有一些对象(textview),并且在textviews中有相同的文本。
我需要根据手机显示切换文字大小。 但如果我把 130dp 放在小显示器上就不好了。
我的代码很少
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="88"
android:id="@+id/hlc"
android:textSize="130dp"
android:textIsSelectable="false"
android:gravity="end"
android:textStyle="bold" />
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:layout_weight="10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="°"
android:id="@+id/textView15"
android:textSize="@android:dimen/notification_large_icon_width"
android:textIsSelectable="false"
android:textStyle="bold"
android:layout_weight="9"
android:textAlignment="viewStart" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="8"
android:id="@+id/hld"
android:textSize= "@android:dimen/notification_large_icon_width"
android:textStyle="bold"
android:textAlignment="viewStart"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
如果我使用 @android:dimen/thumbnail_width 它对于我的格式化显示来说太大了
我需要在textview中用文本填充framelayput。
我无法在此处放置图像:(
...以及如何使用小值、大值等?请举例。 xml 中的示例声明和使用示例。
谢谢。
最佳答案
关于java - 根据显示自动切换textview大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34494437/