Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.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 9patch创建超透明边框:如何删除?_Android_Xml_Android Layout_Nine Patch - Fatal编程技术网

Android 9patch创建超透明边框:如何删除?

Android 9patch创建超透明边框:如何删除?,android,xml,android-layout,nine-patch,Android,Xml,Android Layout,Nine Patch,我的Android应用程序中有一个XML文件。前两个线性布局如下图所示 布局1-半圆 布局2-矩形 注:半圆和矩形之间没有间隙。这个差距就是我现在要解决的问题 实际上,布局1水平有三个子布局垂直,中间子布局包含一个图像视图,即半圆形 当我不使用9面片图像时,没有间隙,它与布局2完美融合。但我需要使用9面片图像,因为可能会不正确地拉伸半圆 但是当我使用9patch图像时,在两个布局之间创建了一个奇怪的分区 这一定是个问题。但如何解决呢? 我只需要一个方法来使用这个半圆的9patch图像,没有这个

我的Android应用程序中有一个XML文件。前两个线性布局如下图所示

布局1-半圆

布局2-矩形

注:半圆和矩形之间没有间隙。这个差距就是我现在要解决的问题

实际上,布局1水平有三个子布局垂直,中间子布局包含一个图像视图,即半圆形

当我不使用9面片图像时,没有间隙,它与布局2完美融合。但我需要使用9面片图像,因为可能会不正确地拉伸半圆

但是当我使用9patch图像时,在两个布局之间创建了一个奇怪的分区

这一定是个问题。但如何解决呢? 我只需要一个方法来使用这个半圆的9patch图像,没有这个间隙,因为它可能看起来很奇怪

注意:9个补片点仅在右侧和左侧空白侧,而不是顶部和底部的任何位置

这是XMl文件的摘录:

 <LinearLayout
     android:id="@+id/name"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal" >

     <LinearLayout
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:orientation="vertical"
         android:layout_weight="2" >
     </LinearLayout>

     <LinearLayout
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:layout_weight="1.98"
         android:gravity="center_horizontal" >

         <ImageView
             android:id="@+id/imageView1"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:src="@drawable/semicircle" />

     </LinearLayout>

     <LinearLayout
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:orientation="vertical"
         android:layout_weight="2" >
     </LinearLayout>

 </LinearLayout>


 <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="2.0"
    android:background="@drawable/rectangle" >

</RelativeLayout>

你甚至可以只使用一个9面片,包含矩形和半圆。我不能将它作为一张图片使用。这个半圆应该像一个按钮@DerGolem@EvanB现在请看编辑。我明白了。无论如何,请在像素级查看9.png文件,查看顶部/底部大于1像素的透明边框。还要确保控件没有任何边距或填充,可能是从样式继承的。