繁体   English   中英

android自定义圆形布局

[英]android custom round layout

我想在链接中制作类似于图像的内容,因此我在底部有两个选项卡,在这些选项卡的中间有一个圆形按钮,并且在图像中有一个片段是蓝色背景。

因此,我可以使选项卡和片段很好。 但是如何将圆形按钮放在选项卡和片段前面?

检查这张图片

谢谢

通过使用FrameLayout

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">

   <ImageView 
   android:src="@drawable/ic_launcher"
   android:layout_height="200dp"
   android:layout_width="200dp"/>

   <Button
   android:text="Frame"
   android:layout_height="wrap_content"
   android:layout_width="wrap_content"
   android:gravity="center"/>
</FrameLayout>

现在按钮在图像的前面。

您可以将layout_marginTop属性添加到希望位于Fragment前面的视图。

  <ImageView 
           android:src="@drawable/ic_launcher"
           android:layout_height="200dp"
           android:layout_width="200dp"
           android:layout_marginTop="-100dp"/>

这将使ImageView 100dp在Fragment之前向上移动。 希望能帮助到你

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM