我刚刚将我的应用程序更新到支持库版本 24.0.0,我收到了有关 BottomSheet 参数的一些错误。
编码:
/**
* 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 Studio 找不到:
android.support.design.R.styleable.BottomSheetBehavior_Params
android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_peekHeight
android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_hideable
知道他们把它搬到哪里了吗?