4

我刚刚将我的应用程序更新到支持库版本 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

知道他们把它搬到哪里了吗?

4

1 回答 1

6

我知道了!他们改变了它的名字。换个词就行ParamLayout
像这样:BottomSheetBehavior_Layout_behavior_peekHeight

官方文档中的更多信息

于 2016-06-21T20:09:51.490 回答