Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在底部导航栏中实现圆形模糊凸起按钮?_Android_Android Layout - Fatal编程技术网

Android 如何在底部导航栏中实现圆形模糊凸起按钮?

Android 如何在底部导航栏中实现圆形模糊凸起按钮?,android,android-layout,Android,Android Layout,我正在尝试实现一个位于应用程序底部的自定义导航栏。这个导航栏包含我不太了解的技巧 以下是所需的导航栏形状 我面对的这个酒吧的窍门是: 来自服务器且经常更改的动态图像视图的模糊 包含摄影机图像和该圆的透明笔划颜色的中间圆 我已经通过使用library解决了第一个问题,它提供了自动模糊背景的布局 不幸的是,我在处理中间摄像头按钮和透明笔划颜色时遇到了问题 这是我正在研究的最新观点 下面是底部导航栏布局的代码 <RelativeLayout android:layout_width=

我正在尝试实现一个位于应用程序底部的自定义导航栏。这个导航栏包含我不太了解的技巧

以下是所需的导航栏形状

我面对的这个酒吧的窍门是:

  • 来自服务器且经常更改的动态图像视图的模糊
  • 包含摄影机图像和该圆的透明笔划颜色的中间圆
  • 我已经通过使用library解决了第一个问题,它提供了自动模糊背景的布局

    不幸的是,我在处理中间摄像头按钮和透明笔划颜色时遇到了问题

    这是我正在研究的最新观点

    下面是底部导航栏布局的代码

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/landing_bottom_toolbar_height"
        android:layout_alignParentBottom="true">
    
        <ImageView
            android:id="@+id/btn_take_photo"
            android:layout_width="@dimen/landing_bottom_toolbar_height"
            android:layout_height="@dimen/landing_bottom_toolbar_height"
            android:scaleType="centerInside"
            android:layout_centerInParent="true"
            android:src="@drawable/ic_camera" />
    
        <com.myapp.view.blur.BlurLinearLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/landing_bottom_inner_toolbar_height"
            android:layout_alignParentBottom="true"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            app:radius="10dp"
            android:weightSum="5">
    
            <ImageButton
                android:id="@+id/btn_my_profile"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:src="@drawable/ic_profile" />
    
            <ImageButton
                android:id="@+id/btn_schedule"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:src="@drawable/ic_calendar" />
    
            <View
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1" />
    
            <ImageButton
                android:id="@+id/btn_settings"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:src="@drawable/ic_settings" />
    
            <ImageButton
                android:id="@+id/btn_contacts"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:src="@drawable/ic_contacts" />
        </com.myapp.view.blur.BlurLinearLayout>
    
    </RelativeLayout>
    
    
    
    任何帮助或指导都将不胜感激

    更新:感谢Machinarius的评论,使摄像头图标级别高于其他按钮,现在是最新的工具栏形状:


    但是仍然需要计算出带有透明笔划颜色的圆形

    将imageView放在模糊布局下方,如果RelativeLayout在这方面的行为类似于FrameLayout,它应该可以工作。如果不是的话,就换掉RelativeLayout,换成FrameLayout,获得同样的效果,稍微提高布局性能。太好了!这使得相机图标位于工具栏上方,但仍然存在着圆形模糊背景和透明笔划颜色的问题。我试着用CLEAR PorterDuffMode玩canvas和setXferMode,但没用,我帮不了你,因为我没有这种布局技巧的经验。在我看来,一对预渲染的模糊面片会让你的生活变得更轻松。@Der Golem我尝试过使用PorterDuff不同的模式,但我所能看到的只是一个黑色笔划,而不是一个透明的笔划。