android中按钮的自定义布局

Thinh Vu

如何自定义按钮的布局?我想创建一个具有如下布局的按钮:

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="aaa" />
    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="bbb" />
</LinearLayout>
JstnPwll

最好和正确的方法是创建Button的子类,并在构造函数中填充自定义XML布局。这样,自定义按钮可重复使用。

这里可以找到更多信息

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章