一、layout代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:padding="15dp">
<Button
android:id="@+id/btn_01"
android:layout_width="match_parent"
android:layout_height="60dp"
android:text="TextView"
android:layout_marginTop="15dp"
/>
<Button
android:id="@+id/btn_02"
android:layout_width="match_parent"
android:layout_height="60dp"
android:text="btn"
android:textColor="#ffff"
android:layout_below="@+id/btn_01"
android:layout_marginTop="15dp"
android:background="@drawable/bg_btn02"
/>
<Button
android:id="@+id/btn_03"
android:layout_width="match_parent"
android:layout_height="60dp"
android:text="btn"
android:textColor="#ffff"
android:layout_bel

本文介绍了Android中Button的布局代码和Java代码实现,包括圆角属性、按压效果的设置,并提供了点击事件的实现方式。同时引用了其他博客的详细资源链接,帮助读者深入理解Button的各种属性和用法。
最低0.47元/天 解锁文章
319

被折叠的 条评论
为什么被折叠?



