BottomNavigationBar 中的隐形背景
我想设置背景透明,但是我已经尝试了所有内容,但我无法设置它。我在此处让我的XML代码和单元格的图片:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MenuPrincipalActivity" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="@+id/frame_layout"/>
<com.etebarian.meowbottomnavigation.MeowBottomNavigation
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:mbn_backgroundBottomColor="#FFFFFF"
app:mbn_circleColor="@color/whiteTextColor"
app:mbn_countBackgroundColor="#ff6f00"
app:mbn_countTextColor="@color/whiteTextColor"
app:mbn_defaultIconColor="@color/black"
app:mbn_selectedIconColor="@color/black"
android:background="@null"/>
</LinearLayout>
如果您看到照片,您可以看到背景不是背景。在XML中,如果我更改了bottomNavigationbar的背景颜色
它会更改,但是我确实尝试了所有内容,但是我无法设置透明的背景。
I want to set the background transparent, but I've tried everything and I can't set it. I let my XML code and a pic of the cell here:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MenuPrincipalActivity" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="@+id/frame_layout"/>
<com.etebarian.meowbottomnavigation.MeowBottomNavigation
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:mbn_backgroundBottomColor="#FFFFFF"
app:mbn_circleColor="@color/whiteTextColor"
app:mbn_countBackgroundColor="#ff6f00"
app:mbn_countTextColor="@color/whiteTextColor"
app:mbn_defaultIconColor="@color/black"
app:mbn_selectedIconColor="@color/black"
android:background="@null"/>
</LinearLayout>
If you see the photo, you can see that the background isn't background. In the XML, if I change the background color of BottomNavigationBar
it changes, but I really tried with everything, but I'm not able to set the transparent background.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在使用 MeowBottomNavigation,通过快速搜索,您可以在这里看到,有人已经要求提供同样的事情 #21
所以试试这个:
You're using a MeowBottomNavigation, with quick search, you can see here, that someone already ask for the same thing #21
So try this :
与其将背景设置为透明颜色,不如创建一个透明的矩形,例如:
drableable \ parraparent_rect.xml
,然后将其设置为
android:background
Instead of setting the background to a transparent color, create a transparent Rectangle drawable like:
drawable\transparent_rect.xml
Then set that to
android:background