1、android里面的样式:就是将几个控件相同的的格式用style资源统一集合在一起,然后再在这几个控件里面调用style,就是一个封装的原理,让代码看着不那么冗长,
2、9.png图片格式:是android特有的格式,在安卓平台上拉伸不会失真的图片格式,在你的SDK\android-sdk-windows\tools里面的draw9patch,点击即可,将你要处理的图片拖动进去。
3、基本的运用:上边黑线:横向拉伸区域,必须要画的,拉伸是横向拉伸,如右边的区域第二个拉伸的就是横向拉伸的效果
左边黑线:纵向拉伸区域,必须要画的,拉伸是纵向拉伸,如右边的区域第一个拉伸的就是纵向拉伸的效果
下边黑线:可选,横向内容显示区域
右边黑线:可选,纵向内容显示区域
一个登陆界面的样式封装:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 使用于登录界面的 登录和密码找回 -->
<style name="login_title_text">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@android:color/white</item>
</style>
<!-- 使用于登录界面的 用户名 密码的清除 -->
<style name = "login_user_and_password_clean">
<item name = "android:layout_width">wrap_content</item>
<item name ="android:layout_height">wrap_content</item>
<item name = "android:src">@drawable/select_copymeituan_login_clean</item>
<item name = "android:layout_alignParentRight">true</item>
<item name = "android:layout_marginRight">25dp</item>
</style>
</resources>