Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/338.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
Java android自定义圆形布局 我想做一些像链接中的图像,所以我在底部有两个标签,在这些标签前面中间有一个圆形按钮,图像中的一个片段是蓝色背景。_Java_Android_Xml_Eclipse - Fatal编程技术网

Java android自定义圆形布局 我想做一些像链接中的图像,所以我在底部有两个标签,在这些标签前面中间有一个圆形按钮,图像中的一个片段是蓝色背景。

Java android自定义圆形布局 我想做一些像链接中的图像,所以我在底部有两个标签,在这些标签前面中间有一个圆形按钮,图像中的一个片段是蓝色背景。,java,android,xml,eclipse,Java,Android,Xml,Eclipse,这样我就能把标签和碎片做好了。但是我怎样才能把圆形按钮放在标签和碎片的前面呢 检查图像 感谢您使用FrameLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:src

这样我就能把标签和碎片做好了。但是我怎样才能把圆形按钮放在标签和碎片的前面呢

检查图像

感谢您使用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属性添加到您希望位于片段前面的视图中。范例

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


这将使ImageView 100dp在片段前面向上移动。希望有帮助

用这个怎么样不是我需要的。但是,你可以使用一个小的圆形布局并使其可点击。使用
相对视图
,这样你就可以在每个视图之上添加视图。