android popupwindow 弹出动画

简介: 引用:http://www.eoeandroid.com/thread-173761-1-1.html  PopupWindow的布局popwindow.xml  注意3个LinearLayout里必须设置clickable和background,这样当点击上去的时候才会有点击效果。

引用:http://www.eoeandroid.com/thread-173761-1-1.html

 PopupWindow的布局popwindow.xml

  注意3个LinearLayout里必须设置clickable和background,这样当点击上去的时候才会有点击效果

  android:clickable="true"

  android:background="@drawable/state_btn_pressed"

?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version= "1.0" encoding= "utf-8" ?>
<LinearLayout
xmlns:android= "http://schemas.android.com/apk/res/android"
android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:orientation= "horizontal"
android:id= "@+id/layout_main"
>
<LinearLayout android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:orientation= "vertical"
android:gravity= "center_horizontal"
android:clickable= "true"
android:background= "@drawable/state_btn_pressed"
android:layout_weight= "1"
android:id= "@+id/btn_0"
>
<ImageView android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:scaleType= "fitCenter"
android:src= "@drawable/ic_call"
>
</ImageView>
<TextView android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:textColor= "#000000"
android:textSize= "18px"
android:text= "电话" >
</TextView>
</LinearLayout>
<LinearLayout android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:orientation= "vertical"
android:gravity= "center_horizontal"
android:clickable= "true"
android:background= "@drawable/state_btn_pressed"
android:layout_weight= "1"
android:id= "@+id/btn_1"
>
<ImageView android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:scaleType= "fitCenter"
android:src= "@drawable/ic_home"
>
</ImageView>
<TextView android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:textColor= "#000"
android:textSize= "18px"
android:text= "空间" >
</TextView>
</LinearLayout>
<LinearLayout android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:orientation= "vertical"
android:gravity= "center_horizontal"
android:clickable= "true"
android:background= "@drawable/state_btn_pressed"
android:layout_weight= "1"
android:id= "@+id/btn_2"
>
<ImageView android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:scaleType= "fitCenter"
android:src= "@drawable/ic_sms"
>
</ImageView>
<TextView android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:textColor= "#000"
android:textSize= "18px"
android:text= "短信"
>
</TextView>
</LinearLayout>
</LinearLayout>


  state_btn_pressed.xml,点击的效果:

?
01
02
03
04
05
06
<?xml version= "1.0" encoding= "utf-8" ?>
<selector xmlns:android= "http://schemas.android.com/apk/res/android" >
<item android:state_pressed= "true"
android:drawable= "@drawable/bg_btn_pressed"
android:padding= "0dp" />
</selector>




1、android图片浏览器 PhotoStore
下载地址 http://www.eoeandroid.com/thread-176574-1-1.html

2、仿QQ--tab切换动画实例
下载地址 http://www.eoeandroid.com/thread-173365-1-1.html

3、基本控件及基本动画效果demo
下载地址 http://www.eoeandroid.com/thread-173358-1-1.html

4、Activity跳转页面切换漂亮效果
下载地址 http://www.eoeandroid.com/thread-173334-1-1.html

5、Android瀑布流加载图片效果实例
下载地址http://www.eoeandroid.com/thread-176638-1-1.html


相关文章
|
3月前
|
XML 开发工具 Android开发
Android动画效果-更新中
Android动画效果-更新中
59 1
|
4月前
|
XML Android开发 数据格式
[Android]动画
[Android]动画
31 0
|
4月前
|
API Android开发 开发者
【Android App】Vulkan实现宇宙中旋转雷达动画效果(附源码和原始视频 超详细必看)
【Android App】Vulkan实现宇宙中旋转雷达动画效果(附源码和原始视频 超详细必看)
68 1
|
4月前
|
XML 小程序 Java
【Android App】给三维魔方贴图以及旋转动画讲解和实战(附源码和演示视频 超详细必看)
【Android App】给三维魔方贴图以及旋转动画讲解和实战(附源码和演示视频 超详细必看)
27 0
|
4月前
|
XML Java Android开发
Android App开发手机阅读中实现平滑翻书效果和卷曲翻书动画实战(附源码 简单易懂 可直接使用)
Android App开发手机阅读中实现平滑翻书效果和卷曲翻书动画实战(附源码 简单易懂 可直接使用)
66 0
|
4月前
|
XML Java Android开发
Android App开发手机阅读中贝塞尔曲线的原理讲解及实现波浪起伏动画实战(附源码和演示视频 可直接使用)
Android App开发手机阅读中贝塞尔曲线的原理讲解及实现波浪起伏动画实战(附源码和演示视频 可直接使用)
44 0
|
4月前
|
XML Java Android开发
Android App开发实战项目之仿手机QQ动感影集动画播放(附源码和演示视频 可直接使用)
Android App开发实战项目之仿手机QQ动感影集动画播放(附源码和演示视频 可直接使用)
28 0
|
4月前
|
XML Java Android开发
Android App开发动画特效之利用滚动器实现平滑翻页(附源码和演示 简单易懂)
Android App开发动画特效之利用滚动器实现平滑翻页(附源码和演示 简单易懂)
40 0
Android App开发动画特效之利用滚动器实现平滑翻页(附源码和演示 简单易懂)
|
4月前
|
XML Java Android开发
Android App开发动画特效之实现百叶窗动画和马赛克动画效果实战演示(附源码和演示视频 可直接使用)
Android App开发动画特效之实现百叶窗动画和马赛克动画效果实战演示(附源码和演示视频 可直接使用)
59 0
|
4月前
|
XML 前端开发 Java
Android App开发动画特效中遮罩动画的讲解及实战演示(附源码 简单易懂 可直接使用)
Android App开发动画特效中遮罩动画的讲解及实战演示(附源码 简单易懂 可直接使用)
52 0