We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用Fragment替换DrawerLayout下的content和drawer时,如果下面是FrameLayout就没办法换颜色,需替换成LinearLayout才能变色 像下面这样才行,如果是FrameLayout或RelativeLayout就会错乱
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawerLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" android:fitsSystemWindows="true"> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" /> <LinearLayout android:id="@+id/drawer" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:orientation="vertical" /> </android.support.v4.widget.DrawerLayout>
下面函数只做了LinearLayout的判断,木有FrameLayout等的判断
public static void setColorForDrawerLayout(Activity activity, DrawerLayout drawerLayout, int color, int statusBarAlpha) ..... // 内容布局不是 LinearLayout 时,设置padding top if (!(contentLayout instanceof LinearLayout) && contentLayout.getChildAt(1) != null) { contentLayout.getChildAt(1).setPadding(0, getStatusBarHeight(activity), 0, 0); } .....
The text was updated successfully, but these errors were encountered:
No branches or pull requests
用Fragment替换DrawerLayout下的content和drawer时,如果下面是FrameLayout就没办法换颜色,需替换成LinearLayout才能变色
像下面这样才行,如果是FrameLayout或RelativeLayout就会错乱
下面函数只做了LinearLayout的判断,木有FrameLayout等的判断
The text was updated successfully, but these errors were encountered: