myc_100 2013-09-27 09:15 采纳率: 10%
浏览 2216

如何删除RelativeLayout中按钮之间的空白?

我发现在 btnToEmail 和 btnToDelete 按钮有空白,我设置了android:layout_marginLeft="0dp",如何删除 RelativeLayout中按钮之间的空白?
CSDN移动问答

<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingTop="3dip"
        android:layout_marginTop="3dip"
        android:background="#DCDCDC" >

        <Button
            android:id="@+id/btnToEmail"
            style="@style/myTextAppearance"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="@string/export" />

       <Button
            android:id="@+id/btnToDelete"
            style="@style/myTextAppearance"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/btnToEmail"
            android:layout_marginLeft="0dp"
            android:text="@string/delete" />

        <Button
            android:id="@+id/btnSet"
            style="@style/myTextAppearance"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/btnToDelete"
            android:layout_marginLeft="0dp"
            android:text="@string/settings" />

        <Button
            android:id="@+id/btnAbout"
            style="@style/myTextAppearance"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/btnSet"
            android:layout_marginLeft="0dp"
            android:text="@string/about" />

        <Button
            android:id="@+id/btnExit"
            style="@style/myTextAppearance"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:text="@string/exit" />
    </RelativeLayout> 
  • 写回答

1条回答

  • longhai326 2013-09-29 07:21
    关注

    应该是新版的SDK Button默认背景导致的
    你可以在button添加android:background="#999999"或者自己定义背景图片

    评论

报告相同问题?

悬赏问题

  • ¥15 spring后端vue前端
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿