最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android圓角按鈕的制作方法

 更新時間:2017年08月25日 11:32:43   作者:一個叫嘟嘟的程序猿  
這篇文章主要為大家詳細(xì)介紹了Android圓角按鈕的制作方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Android制作圓角按鈕的具體代碼,供大家參考,具體內(nèi)容如下

【主要步驟】

創(chuàng)建一個XML文件

以此文件作為Button的Background

1.創(chuàng)建XML文件

在res目錄下的drawable-mdpi下建立XML文件

button_frame_shape.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
  <solid android:color="#ffffff" /><!-- 填充的顏色 -->
  <!-- 設(shè)置按鈕的四個角為弧形 -->
  <!-- android:radius 弧形的半徑 -->
  <corners android:topLeftRadius="5dp"
    android:topRightRadius="5dp"
    android:bottomRightRadius="5dp"
    android:bottomLeftRadius="5dp"/>
  <!-- 邊框粗細(xì)及顏色 -->
  <stroke android:width="2dp" android:color="@color/colorAccent" />
</shape>


2.使用

在Button下使用Android:background=”@drawable/button_frame_shape”

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  android:orientation="vertical" 
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent"> 
<Button  
  android:id="@+id/roundButton" 
  android:text=" 圓角邊框按鈕 " 
  android:layout_width="wrap_content"  
  android:layout_height="wrap_content"  
  android:background="@drawable/button_frame_shape" 
  /> 
</LinearLayout>

效果如圖:

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

来宾市| 城市| 宝清县| 辽阳县| 铜梁县| 马尔康县| 鹤庆县| 常熟市| 汕尾市| 伽师县| 黑山县| 金塔县| 霍林郭勒市| 汤阴县| 安阳县| 洛浦县| 攀枝花市| 平江县| 孝昌县| 江陵县| 抚州市| 昌都县| 普兰店市| 开阳县| 神农架林区| 怀远县| 葫芦岛市| 黄冈市| 东安县| 吴桥县| 惠东县| 阿荣旗| 金华市| 桃园县| 清水河县| 大宁县| 华安县| 县级市| 科尔| 楚雄市| 普定县|