欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

androidshape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果-創(chuàng)新互聯(lián)

這篇文章主要介紹了android shape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

創(chuàng)新互聯(lián)專注于企業(yè)成都全網(wǎng)營(yíng)銷推廣、網(wǎng)站重做改版、麻章網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、html5、成都做商城網(wǎng)站、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為麻章等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。

shape使用、漸變色、分割線、邊框、半透明、半透明陰影效果。

首先簡(jiǎn)單了解一下shape中常見的屬性。(詳細(xì)介紹參看 api文檔)

<?xml version="1.0" encoding="utf-8"?>
<shape
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape=["rectangle" | "oval" | "line" | "ring"] > --- 默認(rèn)為rectangle
 <corners -- shape=“rectangle”時(shí)使用, 
  android:radius="integer" -- 半徑,會(huì)被下邊的屬性覆蓋,默認(rèn)為1dp,
  android:topLeftRadius="integer" 
  android:topRightRadius="integer"
  android:bottomLeftRadius="integer"
  android:bottomRightRadius="integer" />
 <gradient -- 漸變
  android:angle="integer"
  android:centerX="integer"
  android:centerY="integer"
  android:centerColor="integer"
  android:endColor="color"
  android:gradientRadius="integer"
  android:startColor="color"
  android:type=["linear" | "radial" | "sweep"]
  android:useLevel=["true" | "false"] />
 <padding
  android:left="integer"
  android:top="integer"
  android:right="integer"
  android:bottom="integer" />
 <size -- 指定大小,一般用在imageview配合scaleType屬性使用。大小一般會(huì)適配滴
  android:width="integer"
  android:height="integer" />
 <solid -- 填充顏色,可是是十六進(jìn)制顏色。(比如想設(shè)置半透明效果,直接使用十六就只就OK)
  android:color="color" />
 <stroke -- 指定邊框,border,dashWidth和dashGap有一個(gè)為0dp則為實(shí)線
  android:width="integer"
  android:color="color"
  android:dashWidth="integer" -- 虛線寬度
  android:dashGap="integer" /> -- 虛線間隔寬度
</shape>

注意:

<corners>

1、android:radius,半徑,會(huì)被下邊的單個(gè)角度半徑屬性覆蓋,默認(rèn)為1dp,

2、在使用時(shí),如果單獨(dú)設(shè)置四個(gè)角度,又大小不一致時(shí),eclipse的graphics preview會(huì)報(bào)錯(cuò)。但是直接真機(jī)運(yùn)行即可。(比如實(shí)線上邊直角,下邊屈角的效果)

<size>

Note: The shape scales to the size of the container View proportionate to the dimensions defined here, by default. When you use the shape in an ImageView, you can restrict scaling by setting the android:scaleType to "center"

舉個(gè)栗子:

1、漸變色 res/drawable/gradient_box.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">
 <gradient
  android:startColor="#FFFF0000"
  android:endColor="#80FF00FF"
  android:angle="45"/>
 <padding android:left="7dp"
  android:top="7dp"
  android:right="7dp"
  android:bottom="7dp" />
 <corners android:radius="8dp" />
</shape>

如圖:

android shape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果

2、白色邊框、半透明效果

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle" >
 <corners android:radius="16dp" />
 <!-- 這是半透明,還可以設(shè)置全透明,那就是白色邊框的效果了 -->
 <solid android:color="#80065e8d" />
 <stroke
  android:dashGap="0dp"
  android:width="4dp"
  android:color="@android:color/white" />
</shape>

如圖:

android shape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果   android shape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果

3、分割線效果:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="line" >
 <stroke
  android:width="4dp"
  android:color="@android:color/black" />
</shape>

如圖:

android shape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果

4、單邊屈角效果

<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
 
 <corners 
  android:topLeftRadius="5dp"
  android:topRightRadius="5dp"
  android:bottomLeftRadius="30dp"
  android:bottomRightRadius="30dp"/>
 
 <!-- 這是半透明,還可以設(shè)置全透明,那就是白色邊框的效果了 -->
 <solid android:color="#ff065e8d" />
 
 <stroke
  android:dashGap="0dp"
  android:width="4dp"
  android:color="@android:color/white" />
 
</shape>

如圖:

android shape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“android shape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來學(xué)習(xí)!

新聞名稱:androidshape如何實(shí)現(xiàn)漸變色、分割線、邊框、半透明陰影效果-創(chuàng)新互聯(lián)
URL鏈接:http://aaarwkj.com/article24/cccoce.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、關(guān)鍵詞優(yōu)化建站公司、網(wǎng)站設(shè)計(jì)公司、全網(wǎng)營(yíng)銷推廣、品牌網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作
国产91日韩欧美在线观看| 午夜福利尤物一区二区| 日韩精品电影一二三| 日韩有码高清av在线| 欧美日韩中文国产天堂| 欧美一区二区三区免费精品| 亚洲无综合素人在线观看| 人妻久久一区二区三区精品99| 国产日韩精品专区一区| 亚洲av天堂天天天堂色| 亚洲黄色录像一区二区人妻黑人| 日韩在线观看视频有码| 中文字幕国产精品经典三级| 亚洲男人堂色偷偷一区| 美女口爆吞精一区二区| 国产欧美日韩亚洲精品区| 久久久久精品国产亚洲av影院| 亚洲欧美日韩不卡视频| 高质量的性生活在线观看| 国产三级精品三级在线专区1| 国产精品国产成人生活片| 岛国av在线免费观看| 欧美一区二区久久综合| 日本一区二区三区免费看视频| 国产一区二区三区av在线播放| 国产女主播精品视频一区| 青青草原精品视频在线| 国产午夜草莓视频在线观看| 亚洲欧美极品一区色婷婷| 亚洲熟妇中文字幕五十中出| 九九热视频在线观看色| 欧美激情另类综合国内| 日韩精品在线观看视频一区二区三区| 亚洲av毛片一区二区| 亚洲三区四区视频在线观看| 国产日韩精品激情另类综合 | 亚洲香蕉av一区二区蜜桃| 国产精品午夜视频免费观看| 女同av免费观看网站| 精品国产一区二区av麻豆| 亚洲第一国产综合自拍|