Android UI 小结
来源:互联网 发布:mysql 生成连续数字 编辑:程序博客网 时间:2024/05/16 14:50
comman dimen
Text
Color
Other
appcompat-v7
- 在v7中把Android:Theme的声明和View级别关联,表明Theme不在是整体的主题,也可以是某一部分的主题。但android:Theme的定义放在某一部分的style中定义是无效的.
- 重写了一些基本控件的样式,比如buttonStyle,若想要重写button样式,则前面不能加android:字样
- 默认actionBar与Toolbar样式
Toolbar:
<declare-styleable name="Toolbar"> <attr name="titleTextAppearance" format="reference"/> <attr name="subtitleTextAppearance" format="reference"/> <attr name="title"/> <attr name="subtitle"/> <attr name="android:gravity"/> <attr name="titleMargins" format="dimension"/> <attr name="titleMarginStart" format="dimension"/> <attr name="titleMarginEnd" format="dimension"/> <attr name="titleMarginTop" format="dimension"/> <attr name="titleMarginBottom" format="dimension"/> <attr name="contentInsetStart"/> <attr name="contentInsetEnd"/> <attr name="contentInsetLeft"/> <attr name="contentInsetRight"/> <attr name="maxButtonHeight" format="dimension"/> <attr name="collapseIcon" format="reference"/> <attr name="collapseContentDescription" format="string"/> <attr name="popupTheme"/> <attr name="navigationIcon" format="reference"/> <attr name="navigationContentDescription" format="string"/> <attr name="android:minHeight"/> </declare-styleable>
actionbar:
<declare-styleable name="ActionBar"> <attr name="navigationMode"> <enum name="normal" value="0"/> <enum name="listMode" value="1"/> <enum name="tabMode" value="2"/> </attr> <attr name="displayOptions"> <flag name="none" value="0"/> <flag name="useLogo" value="0x1"/> <flag name="showHome" value="0x2"/> <flag name="homeAsUp" value="0x4"/> <flag name="showTitle" value="0x8"/> <flag name="showCustom" value="0x10"/> <flag name="disableHome" value="0x20"/> </attr> <attr name="title"/> <attr name="subtitle" format="string"/> <attr name="titleTextStyle" format="reference"/> <attr name="subtitleTextStyle" format="reference"/> <attr name="icon" format="reference"/> <attr name="logo" format="reference"/> <attr name="divider" format="reference"/> <attr name="background" format="reference"/> <attr name="backgroundStacked" format="reference|color"/> <attr name="backgroundSplit" format="reference|color"/> <attr name="customNavigationLayout" format="reference"/> <attr name="height"/> <attr name="homeLayout" format="reference"/> <attr name="progressBarStyle" format="reference"/> <attr name="indeterminateProgressStyle" format="reference"/> <attr name="progressBarPadding" format="dimension"/> <attr name="homeAsUpIndicator"/> <attr name="itemPadding" format="dimension"/> <attr name="hideOnContentScroll" format="boolean"/> <attr name="contentInsetStart" format="dimension"/> <attr name="contentInsetEnd" format="dimension"/> <attr name="contentInsetLeft" format="dimension"/> <attr name="contentInsetRight" format="dimension"/> <attr name="elevation" format="dimension"/> <attr name="popupTheme" format="reference"/> </declare-styleable>
通过两者对比可以发现Toolbar的属性定义要比actionBar的属性定义要简单很多,虽然actionBar中有很多过时的属性。属性对比可以明显的发现在titleBar的展示上,actionBar与toolBar的样式有明显的区别,不可以通用,这也解释了为什么我们在编码中用toolbar代替actionBar时,theme各种不对路。但二者都有popupTheme属性,则说明在菜单展示样式上,两者是可以通用的。由于actionBar是android默认的实现,主题样式也是按照actionBar的样式实现的。所有当使用Toolbar为ActionBar时,默认的主题样式会有冲突,此时必须指定Toolbar的样式。
Widget
- android.support.v4.widget.DrawerLayout:
注意:抽屉view在content view之前也可以正常显示,但无法正常收到touch事件 结构如下
<DrawerLayout> <抽屉View /> <ContentView /></DrawerLayout>
参考:Material Design
0 0
- Android UI 小结
- android UI小结(一)
- android UI小结(二)
- android UI小结(三)
- android UI小结(四)
- android UI小结(五)
- android UI小结(六)
- Android UI优化小结
- 【Android UI】SlidingTabLayout使用小结
- Android UI布局和事件处理小结
- android UI布局的性能优化小结
- Android开发小结——UI开发
- 【Android】android的基本UI操作(2)以及小结
- android学习笔记第一次UI设计的小结
- 转-Android技巧小结之子线程更新UI
- 最近写UI小结
- UI小结1
- UI小结3
- 怎样在网页中画一条竖线?
- linux下lcd驱动的实现-基础知识篇
- 像素、英寸、厘米之间的换算关系
- 百度地图LBS ItemizedOverlay
- TableView 去掉多余行数、IOS最后一行Cell系统分割线顶头
- Android UI 小结
- Java day10 IO FileWriter
- 推荐工具连接
- apache commons fileupload 1.3.1(一)Mime部分
- Genymotion配置及使用教程(最新最完整版附各部分下载地址)
- div表格定高垂直居中,水平居中
- git常用命令之git branch, checkout使用说明
- 关于Eclipse自动补全的问题
- 从布局动画引入ListView滑动时,每一Item项的显示动画