我在设置菜单/阴影的 addonSlider() (又名滑动菜单)宽度时遇到了一些问题。
我查看了 AddonSlider 类和 SliderMenu 类,没有找到任何涉及设置菜单/阴影宽度的内容。
我发现的唯一一件事是:
private void attach(View view, int gravity) {
if (view == null) {
return;
}
final ViewGroup.LayoutParams initialParams = view.getLayoutParams();
DrawerLayout.LayoutParams params;
if (initialParams instanceof DrawerLayout.LayoutParams) {
params = (LayoutParams) initialParams;
} else if (initialParams != null) {
params = new LayoutParams(initialParams);
} else {
params = new LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
android.view.ViewGroup.LayoutParams.MATCH_PARENT);
}
params.gravity = gravity;
view.setLayoutParams(params);
ViewParent parent = view.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(view);
}
requestDrawerLayout();
mDrawerLayout.addView(view, gravity == Gravity.NO_GRAVITY ? 0 : -1, params);
}
但是弄乱了这个设置让我无处可去