我只是更新了我的应用程序,以支持24.0.0版的库,并且我得到了一些关于BottomSheet Params的错误。
守则:
/**
* Default constructor for inflating BottomSheetBehaviors from layout.
*
* @param context The {@link Context}.
* @param attrs The {@link AttributeSet}.
*/
public BottomSheetBehaviorGoogleMapsLike(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs,
android.support.design.R.styleable.BottomSheetBehavior_Params);
setPeekHeight(a.getDimensionPixelSize(
android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_peekHeight, 0));
setHideable(a.getBoolean(android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_hideable, false));
a.recycle();
ViewConfiguration configuration = ViewConfiguration.get(context);
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}Android找不到:
android.support.design.R.styleable.BottomSheetBehavior_Paramsandroid.support.design.R.styleable.BottomSheetBehavior_Params_behavior_peekHeightandroid.support.design.R.styleable.BottomSheetBehavior_Params_behavior_hideable知道他们把它移到哪里了吗?
发布于 2016-06-21 20:09:51
这样啊,原来是这么回事!他们改名了。只需将单词Param改为Layout即可。
像这样:BottomSheetBehavior_Layout_behavior_peekHeight
更多信息in official docs
https://stackoverflow.com/questions/37953212
复制相似问题