android - AS 找不到 BottomSheetBehavior_Params、_behavior_peekHeight 和 _behavior_hideable

标签 android android-studio android-support-library bottom-sheet android-layoutparams

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

相关文章:

macos - 无法在mac上复制和安装android studio

android - CollapsingToolbarLayout ImageView 不可滚动

安卓工作室 1.5.1 : Could not find property 'vectorDrawables'

java - body.setTransform 在接触监听器(andEngine 和 box2d)中不起作用

android - 如何在 Android 中隐藏进度条?

java - 单击时如何更改变量并将其传递给android中的另一个 Activity (有代码)?

android - 错误 0x502 安卓模拟器

java - 下面带有滚动和编辑文本的弹出菜单

java - Android Studio : W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED

android - 内部 PreferenceScreen 不使用 PreferenceFragmentCompat 打开