**重点内容**
1、自定义string资源
<string name="word_jishibu">记事簿</string>
<string name="word_accountlist">我的账单</string>
<string name="word_myaccount">我的账户</string>
Java代码中的引用
title_tv.setText(getResources().getString(R.string.word_accountlist));
2、自定义color资源:
<color name="ssjGrey">#595959</color>
<color name="ssjBule">#269ce2</color>
<color name="ssjXiaHuaxian">#639fd3</color>
Java中的引用:
ColorBlue= ContextCompat.getColor(this,R.color.ssjBule); ColorGrey=ContextCompat.getColor(this,R.color.ssjGrey);
3、自定义布局在xml中引用:
<include layout="@layout/title_layout"></include>
4、自定义drawable作为按钮背景(绘图)
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:color="#019342"
android:width="2dp"></stroke>
<corners android:radius="5dp"></corners>
<padding android:top="8dp"></padding>
<padding android:bottom="8dp"></padding>
<padding android:left="8dp"></padding>
<padding android:right="8dp"></padding>
</shape>
在xml布局文件中使用;
android:background="@drawable/bottom_login"
5.自定义title的引用
<LinearLayout
android:id="@+id/ll_wx"
style="@style/tab_style">
6、自定义style
<style name="tab_style">
<item name="android:gravity">center</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
</style>
引用:
<LinearLayout
style="@style/tab_style">