Android Layout的问题

wade008 2014-08-08 02:16:52
在Layout文件里新建一个Main.xml文件

像数为1920*1080

然后在Main上放2个ImageButton,图片的大小为440*354(match_parent)

可是在Graphical Layout看到效果,两张图片会有叠加的部分

而按440*2=880,还没有超过1080呀
...全文
127 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
icyblood198999 2014-08-08
  • 打赏
  • 举报
回复
最好上效果图,然后相对布局其实可以用拖动的,所见即所得。
fireyou 2014-08-08
  • 打赏
  • 举报
回复
LinearLayout 设置显示方向,设置控件的距离 肯定可以的。 你的textview也可以指定一个宽带试试
wade008 2014-08-08
  • 打赏
  • 举报
回复
引用 3 楼 fireyou 的回复:
别用 RelativeLayout 用 LinearLayout 吧
还是一样的
fireyou 2014-08-08
  • 打赏
  • 举报
回复
别用 RelativeLayout 用 LinearLayout 吧
wade008 2014-08-08
  • 打赏
  • 举报
回复
引用 1 楼 fireyou 的回复:
贴布局文件代码
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/back1920x1080"
    tools:context=".NtilDisplay" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="11dp"
        android:src="@drawable/noti_icon1" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="11dp"
        android:layout_marginTop="14dp"
        android:layout_toRightOf="@+id/imageView1"
        android:text="@string/app_name"
        android:textColor="@color/encode_view"
        android:textSize="@dimen/test_size_25" />

    <ImageButton
        android:id="@+id/imageButton2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/imageButton1"
        android:src="@drawable/btn_02_monitor_n" />

    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/imageView1"
        android:layout_marginTop="20dp"
        android:src="@drawable/btn_01_call_n" />

</RelativeLayout>
fireyou 2014-08-08
  • 打赏
  • 举报
回复
贴布局文件代码

80,472

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧