我刚刚将我的应用程序更新到支持库版本 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
知道他们把它移到哪里了吗?
最佳答案
我明白了!他们改变了它的名字。只需为 Layout
更改单词 Param
。
像这样:BottomSheetBehavior_Layout_behavior_peekHeight
更多信息 in official docs
关于android - AS 找不到 BottomSheetBehavior_Params、_behavior_peekHeight 和 _behavior_hideable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37953212/