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

Android圓角按鈕的制作方法

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

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

【主要步驟】

創(chuàng)建一個(gè)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è)置按鈕的四個(gè)角為弧形 -->
  <!-- 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>

效果如圖:

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

相關(guān)文章

最新評(píng)論

普定县| 盘锦市| 临海市| 石阡县| 乐陵市| 邢台市| 西宁市| 南平市| 建瓯市| 延安市| 通化县| 石家庄市| 康平县| 乌审旗| 金沙县| 凤庆县| 垫江县| 黎川县| 进贤县| 平谷区| 资源县| 西乌| 平昌县| 哈巴河县| 辽阳市| 福建省| 吉隆县| 东阿县| 德保县| 方山县| 库尔勒市| 桃园县| 涞水县| 深泽县| 商水县| 称多县| 布拖县| 梅河口市| 斗六市| 泾源县| 景谷|