Questions tagged «bottom-sheet»

16
BottomSheetDialogFragment的圆角
我有一个自定义的BttomSheetDialogFragment,我想在底部视图的顶部有圆角 这是我的自定义类,它使我想要从底部显示的布局膨胀 View mView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mView = inflater.inflate(R.layout.charge_layout, container, false); initChargeLayoutViews(); return mView; } 而且我也有这个xml资源文件作为背景: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:topRightRadius="35dp" android:topLeftRadius="35dp" /> <solid android:color="@color/white"/> <padding android:top="10dp" android:bottom="10dp" android:right="16dp" android:left="16dp"/> 但是问题是,当我将此资源文件设置为布局的根元素的背景时,拐角仍未圆化 而且我不能使用下面的代码: this.getDialog().getWindow().setBackgroundDrawableResource(R.drawable.charge_layout_background); 因为它覆盖了BottomSheetDialog的默认背景,并且在我的Bottom View上方没有任何半透明的灰色

3
BottomSheetBehavior不在androidX库中
我BottomSheetBehavior在原始支持库中使用: implementation 'com.android.support:design:27.1.1' 当我迁移使用新androidx库时,尽管BottomSheetBehavior缺少了。以上支持库中的映射也不在AndroidX重构列表中,但迁移工具已将其删除。 我缺少将BottomSheetBehavior包含在新androidx库中的功能。 dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.google.android.material:material:1.0.0-beta01' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // ReactiveX implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0' implementation 'com.android.support:design:28.1.0' // Android Compatability Libraries // Version: https://developer.android.com/topic/libraries/support-library/refactor implementation 'androidx.appcompat:appcompat:1.0.0-beta01' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha1' implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01' implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-beta01' implementation 'androidx.recyclerview:recyclerview:1.0.0-beta01' // Android Navigation Component // Check here for updated …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.