Android控制水平方向字体缩放android:textScaleX

    xiaoxiao2026-04-16  0

    Android控制字体水平方向的缩放属性设置是android:textScaleX,即水平方向放大,备忘小知识点,此处记下。

    作为演示,第一行是正常的默认样式,第二行是设置了android:textScaleX的属性为2。

    代码:

    [html]  view plain  copy   <?xml version="1.0" encoding="utf-8"?>   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"       android:layout_width="match_parent"       android:layout_height="match_parent"       android:orientation="vertical">          <TextView           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:text="Zhang Phil " />          <TextView           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:textScaleX="2"           android:text="Zhang Phil " />      </LinearLayout>  

    代码运行结果如图:

    转载请注明原文地址: https://ju.6miu.com/read-1308905.html
    最新回复(0)