我创建了一个自定义 textview 类。通过这个类,我可以设置字体,设置文本的内阴影,设置文本的外阴影,设置文本的半径和颜色。我也想在按钮中出现的文本中使用 textviews 的这些特性。我已经通过谷歌进行了研究,但我无法找到解决我问题的解决方案。因此,如果有人对此主题有任何想法,那么您将有很大的帮助。
我在我的文本视图中定义的属性是
xmlns:braindigit="http://schemas.android.com/apk/res/com.example.MyCustomTextView" //this is in the main layout
<com.example.MyCustomTextView
android:id="@+id/stateInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/you_are_not_logged_in"
android:textColor="#3191d2"
android:textSize="18sp"
android:textStyle="bold"
braindigit:innerShadowColor="#003456"
braindigit:innerShadowDy="1"
braindigit:innerShadowRadius="1"
braindigit:outerShadowColor="#ffffff"
braindigit:outerShadowDy="1"
braindigit:outerShadowRadius="1" />
自定义文本视图没有问题。但是,我不知道如何将这些自定义文本值用于我的按钮。