相关疑难解决方法(0)

Android中的透明布局?

我正在开发一个使用透明活动的Android应用程序..我使用以下链接作为参考,但我的问题是当我将背景颜色设置为黑色时,我无法看到以前.我需要像这样透明.

替代文字

提前致谢...

android

18
推荐指数
2
解决办法
6万
查看次数

如何更改BottomSheetDialog中的透明背景?

我使用 BottomSheetDialog,出现了一些困难。我想删除黑色背景的背景,并将其更改为透明。我尝试了这个带有透明背景的 BottomSheetDialog,但没有成功。帮我。

[在此输入图像描述][1]

代码是:

BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(getActivity());
    View parentView = getLayoutInflater().inflate(R.layout.content_status_dialog,null);
    bottomSheetDialog.setContentView(parentView);
    BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from((View)parentView.getParent());
    bottomSheetDialog.setCancelable(true);
    bottomSheetBehavior.setPeekHeight((int)TypedValue.applyDimension(
            TypedValue.COMPLEX_UNIT_DIP,100,
            getResources().getDisplayMetrics()));

    bottomSheetDialog.show();
Run Code Online (Sandbox Code Playgroud)

如果我添加一些像这样的样式

 ((View) getView().getParent()).setBackgroundColor(Color.TRANSPARENT);
Run Code Online (Sandbox Code Playgroud)

,它看起来像这样

android

3
推荐指数
1
解决办法
9435
查看次数

标签 统计

android ×2