Android学习笔记---水波纹效果

======================================按下水波纹效果
<?xml version="1.0" encoding="utf-8"?>
<!--波纹效果背景-->
<!--android:color="@color/dark_brown" 按下时的效果-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorPrimary">

<!--正常显示的颜色-->
<item>
<shape>
<!--背景颜色-->
<solid android:color="@color/white"/>
</shape>
</item>
</ripple>
=========================Toolbar和侧滑视图结合======================
toolbar = findView(R.id.toolbar_id);
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_id);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.kai,R.string.guan){
//在菜单关闭的时候执行
@Override
public void onDrawerClosed(View drawerView) {
if(itemdianji){
sowHort();
itemdianji = false;
}
}
};
drawerLayout.setDrawerListener(toggle);

 

<activity
android:name=".activity.MainActivity"
android:screenOrientation="portrait" />
<!--
android:screenOrientation=""
landscape 横屏
portrait 竖屏
sensor 根据传感器方向
user 用户设置方法
behind 跟随activity栈中的前一个

 

 

 

估计是有问题的 先记录 以后修改

posted @ 2017-09-26 18:01  纯属浪费8818  阅读(286)  评论(0编辑  收藏  举报