按鈕,圓形按鈕,帶文字的圖片按鈕,圓形按鈕

來源:互聯網
上載者:User

按鈕,圓形按鈕,帶文字的圖片按鈕,圓形按鈕

    

 

Demo2\button_demo\src\main\res\drawable\button_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>

 

Demo2\button_demo\src\main\res\layout\activity_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     <Button19         android:layout_width="wrap_content"20         android:layout_height="wrap_content"21         android:background="#ff1827"22         android:text="普通按鈕"23         android:textSize="10dp" />24     <!--帶文字的圖片按鈕-->25     <Button26         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>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.