android 总结(样式)—跑马灯 button的点击效果 RadioGroup 实现滑动的效果 button 下面有阴影 卡片样式
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector_new"
android:text="点击" />
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:enterFadeDuration="1000" android:exitFadeDuration="500">
<item android:drawable="@color/color_new" android:state_pressed="true">
<color android:color="@color/color_new"></color>
</item>
<item android:drawable="@color/color_new1">
<color android:color="@color/color_new1"></color>
</item>
</selector>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"> <RadioButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/layer_list"
android:button="@null"
android:gravity="center"
android:text="1" /> <RadioButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/layer_list"
android:button="@null"
android:gravity="center"
android:text="2" /> <RadioButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/layer_list"
android:button="@null"
android:gravity="center"
android:text="3" />
</RadioGroup>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<layer-list>
<item>
<color android:color="@color/color_new1" />
</item>
<item android:bottom="4dp" android:drawable="@android:color/white"></item>
</layer-list> </item> <item android:state_checked="false">
<layer-list>
<item>
<color android:color="@color/color_new1" />
</item>
<item android:bottom="1dp" android:drawable="@android:color/white"></item>
</layer-list> </item>
</selector> 有阴影的效果
<Button
android:id="@+id/btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:background="@drawable/selector_btn"
android:text="对对对" />
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 灰色阴影 -->
<item
android:left="2dp"
android:top="4dp">
<shape>
<solid android:color="@android:color/darker_gray" />
<corners android:radius="10dp" />
</shape>
</item>
<!-- 白色前景 -->
<item
android:bottom="4dp"
android:right="2dp">
<shape>
<solid android:color="#FFFFFF" />
<corners android:radius="10dp" />
</shape>
</item>
</layer-list>
<drawable name="screen_background_light_transparent">#80ffffff</drawable>
<color name="safe_mode_text">#80ffffff</color>
<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
<color name="transparent">#00000000</color>
<color name="background_dark">#ff000000</color>
<color name="background_light">#ffffffff</color>
<color name="bright_foreground_dark">@android:color/background_light</color>
<color name="bright_foreground_light">@android:color/background_dark</color>
<color name="bright_foreground_dark_disabled">#80ffffff</color>
<color name="bright_foreground_light_disabled">#80000000</color>
<color name="bright_foreground_dark_inverse">@android:color/bright_foreground_light</color>
<color name="bright_foreground_light_inverse">@android:color/bright_foreground_dark</color>
<color name="dim_foreground_dark">#bebebe</color>
<color name="dim_foreground_dark_disabled">#80bebebe</color>
<color name="dim_foreground_dark_inverse">#323232</color>
<color name="dim_foreground_dark_inverse_disabled">#80323232</color>
<color name="hint_foreground_dark">#808080</color>
<color name="dim_foreground_light">#323232</color>
<color name="dim_foreground_light_disabled">#80323232</color>
<color name="dim_foreground_light_inverse">#bebebe</color>
<color name="dim_foreground_light_inverse_disabled">#80bebebe</color>
<color name="hint_foreground_light">#808080</color>
<color name="highlighted_text_dark">#9983CC39</color>
<color name="highlighted_text_light">#9983CC39</color>
<color name="link_text_dark">#5c5cff</color>
<color name="link_text_light">#0000ee</color>
<color name="suggestion_highlight_text">#177bbd</color> <drawable name="stat_notify_sync_noanim">@drawable/stat_notify_sync_anim0</drawable>
<drawable name="stat_sys_download_done">@drawable/stat_sys_download_done_static</drawable>
<drawable name="stat_sys_upload_done">@drawable/stat_sys_upload_anim0</drawable>
<drawable name="dialog_frame">@drawable/panel_background</drawable>
<drawable name="alert_dark_frame">@drawable/popup_full_dark</drawable>
<drawable name="alert_light_frame">@drawable/popup_full_bright</drawable>
<drawable name="menu_frame">@drawable/menu_background</drawable>
<drawable name="menu_full_frame">@drawable/menu_background_fill_parent_width</drawable>
<drawable name="editbox_dropdown_dark_frame">@drawable/editbox_dropdown_background_dark</drawable>
<drawable name="editbox_dropdown_light_frame">@drawable/editbox_dropdown_background</drawable> <drawable name="input_method_fullscreen_background">#fff9f9f9</drawable>
<color name="input_method_navigation_guard">#ff000000</color> <!-- For date picker widget -->
<drawable name="selected_day_background">#ff0092f4</drawable> <!-- For settings framework -->
<color name="lighter_gray">#ddd</color>
<color name="darker_gray">#aaa</color> <!-- For security permissions -->
<color name="perms_dangerous_grp_color">#33b5e5</color>
<color name="perms_dangerous_perm_color">#33b5e5</color>
<color name="shadow">#cc222222</color>
<color name="perms_costs_money">#fff4511e</color> <!-- For search-related UIs -->
<color name="search_url_text_normal">#7fa87f</color>
<color name="search_url_text_selected">@android:color/black</color>
<color name="search_url_text_pressed">@android:color/black</color>
<color name="search_widget_corpus_item_background">@android:color/lighter_gray</color> <!-- SlidingTab -->
<color name="sliding_tab_text_color_active">@android:color/black</color>
<color name="sliding_tab_text_color_shadow">@android:color/black</color> <!-- keyguard tab -->
<color name="keyguard_text_color_normal">#ffffff</color>
<color name="keyguard_text_color_unlock">#a7d84c</color>
<color name="keyguard_text_color_soundoff">#ffffff</color>
<color name="keyguard_text_color_soundon">#e69310</color>
<color name="keyguard_text_color_decline">#fe0a5a</color> <!-- keyguard clock -->
<color name="lockscreen_clock_background">#ffffffff</color>
<color name="lockscreen_clock_foreground">#ffffffff</color>
<color name="lockscreen_clock_am_pm">#ffffffff</color>
<color name="lockscreen_owner_info">#ff9a9a9a</color> <!-- keyguard overscroll widget pager -->
<color name="kg_multi_user_text_active">#ffffffff</color>
<color name="kg_multi_user_text_inactive">#ff808080</color>
<color name="kg_widget_pager_gradient">#ffffffff</color> <!-- LockPatternView -->
<color name="lock_pattern_view_regular_color">#ffffffff</color>
<color name="lock_pattern_view_success_color">#ffffffff</color>
<color name="lock_pattern_view_error_color">#fff4511e</color> <!-- FaceLock -->
<color name="facelock_spotlight_mask">#CC000000</color> <color name="micro_text_light">#434343</color> <drawable name="notification_template_icon_bg">#3333B5E5</drawable>
<drawable name="notification_template_icon_low_bg">#0cffffff</drawable>
<drawable name="notification_template_divider">#29000000</drawable>
<drawable name="notification_template_divider_media">#29ffffff</drawable> <color name="notification_icon_bg_color">#ff9e9e9e</color>
<color name="notification_action_color_filter">@color/secondary_text_material_light</color> <color name="notification_media_primary_color">@color/primary_text_material_dark</color>
<color name="notification_media_secondary_color">@color/secondary_text_material_dark</color> <color name="notification_progress_background_color">@color/secondary_text_material_light</color> <!-- Keyguard colors -->
<color name="keyguard_avatar_frame_color">#ffffffff</color>
<color name="keyguard_avatar_frame_shadow_color">#80000000</color>
<color name="keyguard_avatar_nick_color">#ffffffff</color>
<color name="keyguard_avatar_frame_pressed_color">#ff35b5e5</color> <color name="accessibility_focus_highlight">#bf39b500</color> <color name="system_notification_accent_color">#ff607D8B</color>
<color name="battery_saver_mode_color">#fff4511e</color><!-- deep orange 600 --> <!-- Default user icon colors -->
<color name="user_icon_1">#ff00bcd4</color><!-- teal 500 -->
<color name="user_icon_2">#ff3f51b5</color><!-- indigo 500 -->
<color name="user_icon_3">#ff4285f4</color><!-- blue 500 -->
<color name="user_icon_4">#ffe91e63</color><!-- pink 500 -->
<color name="user_icon_5">#ff0f9d58</color><!-- green 500 -->
<color name="user_icon_6">#ff8bc34a</color><!-- light green 500 -->
<color name="user_icon_7">#ffff9800</color><!-- orange 500 -->
<color name="user_icon_8">#ffff5722</color><!-- deep orange 500 -->
<color name="user_icon_default_gray">#ff9e9e9e</color><!-- gray 500 -->
<color name="user_icon_default_white">#ffffffff</color><!-- white --> <!-- Multi-sim sim colors -->
<color name="Teal_700">#ff00796b</color>
<color name="Teal_800">#ff00695c</color>
<color name="Blue_700">#ff3367d6</color>
<color name="Blue_800">#ff2a56c6</color>
<color name="Indigo_700">#ff303f9f</color>
<color name="Indigo_800">#ff283593</color>
<color name="Purple_700">#ff7b1fa2</color>
<color name="Purple_800">#ff6a1b9a</color>
<color name="Pink_700">#ffc2185b</color>
<color name="Pink_800">#ffad1457</color>
<color name="Red_700">#ffc53929</color>
<color name="Red_800">#ffb93221</color> <color name="chooser_service_row_background_color">#fff5f5f5</color>
</resources>
android 总结(样式)—跑马灯 button的点击效果 RadioGroup 实现滑动的效果 button 下面有阴影 卡片样式的更多相关文章
- 【Android】TextView跑马灯效果
老规矩,先上图看效果. 说明 TextView的跑马灯效果也就是指当你只想让TextView单行显示,可是文本内容却又超过一行时,自动从左往右慢慢滑动显示的效果就叫跑马灯效果. 其实,TextView ...
- android中实现跑马灯效果以及AutoCompleteTestView与MultiAutoCompleteTextView的学习
跑马灯效果 1.用过属性的方式实现跑马灯效果 属性: android:singleLine="true" 这个属性是设置TextView文本中文字 ...
- Android 自定义View跑马灯效果(一)
今天通过书籍重新复习了一遍自定义VIew,为了加强自己的学习,我把它写在博客里面,有兴趣的可以看一下,相互学习共同进步: 通过自定义一个跑马灯效果,来诠释一下简单的效果: 一.创建一个类继承View, ...
- Android:TextView文字跑马灯的效果实现
解决TextView文字显示不全的问题. 简单设置跑马灯的效果: <TextView android:id="@+id/textView" android:layout_wi ...
- android:ellipsize实现跑马灯效果总结(转)
最近无意间看到了涉及到跑马灯效果的代码,于是在网上查阅了很多资料,在这里对自己看的一些文章进行一下总结,顺便加上自己的一些体会. 让我们一步步逐渐向下. 首先我们要实现走马灯这样一个效果,通常来说 ...
- Android TextView实现跑马灯
TextView实现跑马灯的效果:例子一: 这个例子可以解决给一个TextView实现跑马灯的效果,但是不能解决给所有的TextView实现跑马灯的效果. <TextView android:l ...
- android:ellipsize实现跑马灯效果总结
最近无意间看到了涉及到跑马灯效果的代码,于是在网上查阅了很多资料,在这里对自己看的一些文章进行一下总结,顺便加上自己的一些体会. 让我们一步步逐渐向下. 首先我们要实现走马灯这样一个效果,通常来说都是 ...
- android 怎么实现跑马灯效果
自定义控件 FocusedTextView, 使android系统误以为它拥有焦点 public class FocusedTextView extends TextView { public Foc ...
- android ViewPager实现 跑马灯切换图片+多种切换动画
近期在弄个项目.要求有跑马灯效果的图片展示. 网上搜了一堆,都没有完美实现的算了还是自己写吧! 实现原理利用 ViewPager 控件,这个控件本身就支持滑动翻页非常好非常强大好多功能都能用上它.利用 ...
随机推荐
- UITableView中Cell和section的插入与删除
插入段: - (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animati ...
- 如何知道btree树的高度
来自网络,总结到这里: 当我想看btree树高度的时候,筛选出来这篇文章"为什么 B-tree 在不同著作中度的定义有一定差别?",知道了高度的算法是这个公式:但是里面又提高t和出 ...
- 关于</div>的粗浅理解
</div>作为c#中常用的一个标签,在写多个区域的内容时有着十分重要的作用.如果写简单的网页时不用div可能感受不到太大的影响,但是在写较为复杂的程序时div的分隔作用就很明显了,改动大 ...
- android常见问题
1.广播接收器中启动Activity,需要在intent中添加FLAG_ACTIVITY_NEW_TASK /** * Demo描述: * 在BroadcastReceiver中启动Activity的 ...
- Burning Bridges-ZOJ1588(割边求解)
Burning Bridges Time Limit: 5 Seconds Memory Limit: 32768 KB Ferry Kingdom is a nice little country ...
- python简单实现用户表单登录
实现简单的用户表单验证登录 user="desperado" pwd=" s=0 for i in range(10): if s < 3: username = ...
- [问题2014S09] 解答
[问题2014S09] 解答 充分性: 先证明对 Jordan 块 \(J_r(1)\) 以及任意的正整数 \(m\), 均有 \(J_r(1)^m\) 相似于 \(J_r(1)\). 设 \(N ...
- sql语句中left join、inner join中的on与where的区别
table a(id, type): id type ---------------------------------- 1 1 2 1 3 2 table b ...
- Android Studio常见问题 -- uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library
问题描述 * What went wrong:Execution failed for task ':app:processDebugManifest'.> Manifest merger fa ...
- linux共享库
linux共享库 linux中共享库一般以.so.x.y.z 命名,其中x,y,z分别为主版本号.次版本号.发布版本号.同一个库,主版本号不同则相互不兼容:主版本相同,次版本号高的库比次版本号低的库有 ...