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

Android實(shí)現(xiàn)水波紋點(diǎn)擊效果

 更新時(shí)間:2017年03月02日 11:55:49   作者:Android_yyx  
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)水波紋點(diǎn)擊效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

Android實(shí)現(xiàn)水波紋點(diǎn)擊效果只在Android5.0以上版本有效,水波紋點(diǎn)擊效果代碼供大家參考,具體內(nèi)容如下


圓角背景的水波紋效果(如上圖)

1. 定義一個(gè)普通圓角背景的xml;

rounded_corners.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">
 <solid android:color="#FFFFFF" />
 <corners android:radius="4dp" />
</shape>

2. 這里是重點(diǎn),<ripple>是API21才有的新Tag,正是實(shí)現(xiàn)水波紋效果的;
其中<ripple Android:color="#FF21272B" .... />這個(gè)是指定水波紋的顏色,而<item />里面的東西,我們都很熟悉,就是普通的定義一個(gè)帶圓角的背景。

ripple_bg.xml:

<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
 android:color="#FF21272B">
 <item>
  <shape android:shape="rectangle">
   <solid android:color="#FFFFFF" />
   <corners android:radius="4dp" />
  </shape>
 </item>
 <item android:drawable="@drawable/rounded_corners" />
</ripple>

3. 這是Activity的布局xml;

<Button android:background="@drawable/ripple_bg"... />直接使用ripple_bg作為背景。

activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:gravity="center"
 android:orientation="vertical"
 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 tools:context=".MainActivity">

 <TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="@string/hello_world" />

 <Button
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:background="@drawable/ripple_bg"
  android:text="@string/hello_world" />
</LinearLayout>

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

相關(guān)文章

  • android編程實(shí)現(xiàn)局部界面動(dòng)態(tài)切換的方法

    android編程實(shí)現(xiàn)局部界面動(dòng)態(tài)切換的方法

    這篇文章主要介紹了android編程實(shí)現(xiàn)局部界面動(dòng)態(tài)切換的方法,以實(shí)例形式較為詳細(xì)的分析了Android局部切換的布局及功能實(shí)現(xiàn)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2015-11-11
  • Android 異步任務(wù)和消息機(jī)制面試題分析

    Android 異步任務(wù)和消息機(jī)制面試題分析

    這篇文章主要為大家介紹了Android 異步任務(wù)和消息機(jī)制面試題分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-07-07
  • 詳解android進(jìn)行異步更新UI的四種方式

    詳解android進(jìn)行異步更新UI的四種方式

    本篇文章主要介紹了詳解android進(jìn)行異步更新UI的四種方式,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-05-05
  • Android?Intent通信詳細(xì)講解

    Android?Intent通信詳細(xì)講解

    Android進(jìn)程間通信(IPC,Inter-Process?Communication)底層采用的是?Binder?機(jī)制,具體到應(yīng)用層有網(wǎng)友根據(jù)安卓四大組件將進(jìn)程間通信方式分為對(duì)應(yīng)的四種方式?Activity,?Broadcast,?ContentProvider,?Service
    2022-12-12
  • Android編程實(shí)現(xiàn)簡(jiǎn)單流量管理功能實(shí)例

    Android編程實(shí)現(xiàn)簡(jiǎn)單流量管理功能實(shí)例

    這篇文章主要介紹了Android編程實(shí)現(xiàn)簡(jiǎn)單流量管理功能的方法,結(jié)合實(shí)例形式分析了Android實(shí)現(xiàn)流量監(jiān)控所涉及的功能模塊與布局技巧,需要的朋友可以參考下
    2016-02-02
  • Android APP性能優(yōu)化分析

    Android APP性能優(yōu)化分析

    這篇文章主要給大家講了Android APP性能優(yōu)化相關(guān)的思考以及優(yōu)化重點(diǎn)分析,需要的朋友參考下吧。
    2017-12-12
  • 詳解Android創(chuàng)建Handler的必備知識(shí)點(diǎn)

    詳解Android創(chuàng)建Handler的必備知識(shí)點(diǎn)

    本篇文章主要介紹Handler中需要了解的幾個(gè)必備知識(shí)點(diǎn),比如Handler創(chuàng)建、異步Handler是個(gè)啥及如何創(chuàng)建,感興趣的小伙伴快跟隨小編一起學(xué)習(xí)一下
    2022-10-10
  • Android線程間通信Handler源碼詳解

    Android線程間通信Handler源碼詳解

    這篇文章主要為大家介紹了Android線程間通信Handler源碼示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-10-10
  • Android實(shí)現(xiàn)3種側(cè)滑效果(仿qq側(cè)滑、抽屜側(cè)滑、普通側(cè)滑)

    Android實(shí)現(xiàn)3種側(cè)滑效果(仿qq側(cè)滑、抽屜側(cè)滑、普通側(cè)滑)

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)多種側(cè)滑效果,包括仿qq側(cè)滑,抽屜側(cè)滑,普通側(cè)滑三種效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-04-04
  • android平臺(tái)HttpGet、HttpPost請(qǐng)求實(shí)例

    android平臺(tái)HttpGet、HttpPost請(qǐng)求實(shí)例

    出自網(wǎng)絡(luò)搜索引擎巨頭的Android平臺(tái),其對(duì)網(wǎng)絡(luò)的支持自然不用多說(shuō),在Android SDK中已經(jīng)集成了Apache的HttpClient模塊。使用HttpClient模塊,我們就可以使用HTTP協(xié)議進(jìn)行網(wǎng)絡(luò)連接了
    2014-05-05

最新評(píng)論

精河县| 金平| 锡林郭勒盟| 乐安县| 团风县| 沾化县| 金湖县| 成安县| 兴隆县| 苍溪县| 商都县| 达拉特旗| 清远市| 都昌县| 巴塘县| 南平市| 博兴县| 佳木斯市| 浮山县| 长寿区| 竹北市| 铜山县| 思南县| 阜康市| 澎湖县| 额敏县| 启东市| 辽中县| 阿巴嘎旗| 内丘县| 封丘县| 揭阳市| 唐河县| 中超| 项城市| 榆社县| 宁强县| 宜宾县| 钟祥市| 宣武区| 平原县|