直播平台怎么搭建,android开发设置Button背景颜色

直播平台怎么搭建,android开发设置Button背景颜色

1 :在drawable里新建一个setbar_bg.xml,代码为

 


<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <!-- 背景色 -->
    <solid android:color="#00000000"/>
    <!-- 边框色 -->
    <stroke android:width="0.5dip" android:color="#f00" />
</shape>

2:在需要的Button里面添加 android:background="@drawable/setbar_bg"

 


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ListActivity"
    android:orientation="vertical"
    >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="结算单列表"
        android:textSize="30sp"
        android:layout_gravity="center"/>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
        <Button
            android:layout_width="210dp"
            android:layout_height="wrap_content"
            android:text="未结算"
            android:textSize="25sp"
            android:background="@drawable/setbar_bg"
            android:textColor="#9E131312"
            />
        <Button
            android:layout_width="210dp"
            android:layout_height="wrap_content"
            android:text="已结算"
            android:textSize="25sp"
            android:background="@drawable/setbar_bg"
            android:textColor="#9E131312"
            />
    </LinearLayout>
</LinearLayout>

 

以上就是 直播平台怎么搭建,android开发设置Button背景颜色,更多内容欢迎关注之后的文章

 

posted @ 2022-09-08 14:13  云豹科技-苏凌霄  阅读(59)  评论(0)    收藏  举报