配置

1.按钮选中切换

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true" android:drawable="@drawable/ac1"></item>
    <item android:state_checked="false" android:drawable="@drawable/ac0"></item>
</selector>

2.圆角

<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#000"></solid>
    <corners android:radius="3dp"></corners>

</shape>


3.圆角2

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- 设置圆角半径  还可分别详细设置上下左右4个圆角-->
    <corners android:radius="20dp"/>
    <!-- 内部颜色  -->
    <solid android:color="#FFF"/>
    <!-- 边框宽度 边框颜色 -->
    <stroke android:width="1dp" android:color="#F5F5F5"/>


</shape>

4.跑马灯自定义

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="ADTextView">
        <!--文字进入与消失的时间-->
        <attr name="ad_text_view_speed" format="integer"/>

        <!--文字停留在中心的时间-->
        <attr name="ad_text_view_interval" format="integer"/>

        <!--前缀文字颜色-->
        <attr name="ad_text_front_color" format="color"/>
        <!--前缀文字大小-->
        <attr name="ad_text_front_size" format="dimension"/>

        <!--内容文字颜色-->
        <attr name="ad_text_content_color" format="color"/>
        <!--内容文字大小-->
        <attr name="ad_text_content_size" format="dimension"/>
    </declare-styleable>

</resources>

5.NoActionBar可以设置无标题

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>


    <declare-styleable name="AddDeleteViewStyle">
        <attr name="left_text" format="string"/>
        <attr name="right_text" format="string"/>
        <attr name="middle_text" format="string"/>
    </declare-styleable>

</resources>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值