我是靠谱客的博主 虚幻苗条,这篇文章主要介绍页面跳转动画/按钮样式布局模版,现在分享给大家,希望可以做个参考。

overridePendingTransition(R.anim.jin, R.anim.chu);   //跳转动画

res下

文件夹anim

复制代码
1
2
3
4
5
6
7
8
9
10
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromXDelta="-100%p" android:toXDelta="0" android:fromYDelta="0" android:toYDelta="0" android:duration="5000" /> </set>
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
当前Activity不动的动画:
复制代码
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:fromYDelta="0"
        android:toXDelta="0"
        android:duration="300"
    />
</set>
复制代码
1
复制代码
1
按钮的样式布局:
复制代码
1
drawable下创建xml文件:
复制代码
1
2
3
4
5
6
7
8
9
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
复制代码
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape>
            <stroke android:width="1dp"  android:color="#333333" />
            <corners android:radius="5dp"/>
        </shape>
    </item>
</selector>
复制代码
复制代码
点击改变按钮颜色等属性的xml设置:
复制代码
复制代码
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_pressed="true">
        <shape>
            <gradient android:angle="90" android:endColor="#ffa33d" android:startColor="#ff7c00" />

            <stroke android:width="1dip" android:color="#fd9417" />

            <corners android:radius="5dp" />

            <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
        </shape>
    </item>
    <item android:state_focused="true">
        <shape>
            <gradient android:angle="90" android:endColor="#fcd673" android:startColor="#eb9212" />

            <stroke android:width="1dip" android:color="#dc6b00" />

            <corners android:radius="5dp" />

            <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
        </shape>
    </item>
    <item>
        <shape>
            <gradient android:angle="90" android:endColor="#6f859c" android:startColor="#25486e" />

            <stroke android:width="1dip" android:color="#06274a" />

            <corners android:radius="5dip" />

            <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
        </shape>
    </item>
</selector>

复制代码

最后

以上就是虚幻苗条最近收集整理的关于页面跳转动画/按钮样式布局模版的全部内容,更多相关页面跳转动画/按钮样式布局模版内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(85)

评论列表共有 0 条评论

立即
投稿
返回
顶部