android popupwindow 弹出动画

引用: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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值