zoukankan      html  css  js  c++  java
  • 按钮,圆形按钮,带文字的图片按钮

        

    Demo2utton_demosrcmain esdrawableutton_selector.xml

    1 <?xml version="1.0" encoding="utf-8"?>
    2 <selector xmlns:android="http://schemas.android.com/apk/res/android">
    3     <item android:state_pressed="true" android:drawable="@mipmap/favoured_icon"></item>
    4     <item android:state_pressed="false" android:drawable="@mipmap/s_rate_crown"></item>
    5 </selector>

    Demo2utton_demosrcmain eslayoutactivity_main.xml

     1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     2     xmlns:tools="http://schemas.android.com/tools"
     3     android:layout_width="match_parent"
     4     android:layout_height="match_parent"
     5     android:orientation="vertical"
     6     tools:context=".MainActivity">
     7     <!--文字带阴影的按钮-->
     8     <Button
     9         android:layout_width="wrap_content"
    10         android:layout_height="wrap_content"
    11         android:shadowColor="#aa5"
    12         android:shadowDx="5"
    13         android:shadowDy="5"
    14         android:shadowRadius="1"
    15         android:text="文字带阴影的按钮"
    16         android:textSize="12dp" />
    17     <!--普通的文字按钮-->
    18     <Button
    19         android:layout_width="wrap_content"
    20         android:layout_height="wrap_content"
    21         android:background="#ff1827"
    22         android:text="普通按钮"
    23         android:textSize="10dp" />
    24     <!--带文字的图片按钮-->
    25     <Button
    26         android:layout_width="wrap_content"
    27         android:layout_height="wrap_content"
    28         android:background="@drawable/button_selector"
    29         android:text="带文字的图片按钮"
    30         android:textSize="11dp" />
    31 </LinearLayout>
  • 相关阅读:
    【Linux】grep or
    win10查看WiFi密码
    【WPF】Border有显示模糊的情况
    【Spark】配置项spark.network.timeout 的单位是什么
    【Linux】free命令中 free与 available 的区别
    Spark2.3配置项
    java获取jar包执行路径
    编译 thrift-0.14.2 的 C++ 版本
    拉端保障方案
    编译运行ebpf代码的流水账
  • 原文地址:https://www.cnblogs.com/LY1124/p/4672418.html
Copyright © 2011-2022 走看看