我想通过布局标签中的变量标签将我的编辑文本大小更改为数据绑定,但我无法设置正确的大小。
我在这里添加了我的自定义编辑文本布局,我也在粘贴我的布局,所以请指导我在布局中使用此编辑文本时如何设置动态文本大小。
这是自定义编辑文本布局,我在其中声明了 textSize 变量并且类型为 Float
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="android.text.InputType" />
<variable name="textSize" type="Float" />
<variable name="inputType1" type="Integer" />
<variable name="visibility" type="Boolean" />
<variable name="textColor" type="Integer" />
<variable name="holderColor" type="Integer" />
<variable name="hintColor" type="Integer" />
<variable name="holderText" type="String" />
<variable name="hintText" type="String" />
<variable name="holderVisibility" type="Boolean" />
<variable name="leftIcon" type="android.graphics.drawable.Drawable" />
<variable name="editTextBottomLine" type="android.graphics.drawable.Drawable" />
<variable name="rightIcon" type="android.graphics.drawable.Drawable" />
<variable name="fontStyle" type="Integer" />
<variable name="textField" type="androidx.databinding.ObservableField<String>" />
<variable name="isTypePhoneNo" type="Boolean" />
<variable name="contentMaxLength" type="Integer" />
<variable name="emojiVisibility" …
Run Code Online (Sandbox Code Playgroud)