ITPub博客

首页 > 应用开发 > IT综合 > 控制文字水平方向的缩放,带货直播源码怎样实现

控制文字水平方向的缩放,带货直播源码怎样实现

IT综合 作者:云豹科技阿星 时间:2021-09-14 16:46:58 0 删除 编辑

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

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

代码:

<?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 CSDN" />
 
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textScaleX="2"
        android:text="Zhang Phil CSDN" />
 
</LinearLayout>

代码运行结果如图:

 声明:本文由云豹科技转发自zhangphil博客,如有侵权请联系作者删除


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69982461/viewspace-2792048/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-08-24

  • 博文量
    239
  • 访问量
    115528