布局问题,具体看图
androidstudio吧
全部回复
仅看楼主
level 5
布局上是这样的
虚拟机上就变这样了
2017年03月24日 03点03分 1
level 5
这什么鬼,知道分辨率和dpi会导致一些布局变化,这变化的太诡异了吧
2017年03月24日 03点03分 2
level 7
你不贴出来代码怎么看啊
2017年03月24日 10点03分 3
楼下
2017年03月25日 02点03分
level 5
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.cqshe.scm_1.MainActivity">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/news_b2" />
<ImageButton
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/text_b2" />
<ImageButton
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/map_b2" />
<ImageButton
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/imageButton" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<TextView
android:text="新闻"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView4"
android:gravity="center"
tools:text="新闻" />
<TextView
android:text="记事本"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3"
android:gravity="center"
tools:text="记事本" />
<TextView
android:text="导航"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:gravity="center"
tools:text="导航" />
<TextView
android:text="签到"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:gravity="center"
tools:text="签到" />
</TableRow>
</TableLayout>
<Button
android:text="图片"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img"
android:layout_alignBaseline="@+id/text"
android:layout_alignBottom="@+id/text"
android:layout_centerHorizontal="true"
tools:text="图片" />
<Button
android:text="视频"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/video"
android:layout_alignBaseline="@+id/img"
android:layout_alignBottom="@+id/img"
android:layout_toRightOf="@+id/img"
android:layout_toEndOf="@+id/img"
android:layout_marginLeft="21dp"
android:layout_marginStart="21dp"
tools:text="视频" />
<Button
android:text="文字"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text"
tools:text="文字"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/img"
android:layout_toStartOf="@+id/img"
android:layout_marginRight="19dp"
android:layout_marginEnd="19dp" />
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="80dp"
android:layout_below="@+id/img"
android:id="@+id/list" />
</RelativeLayout>
2017年03月25日 02点03分 4
level 1
你解决了么????
2017年04月23日 12点04分 5
解决了,不知道为什么在这个界面里面src那个设置图片的设置无效,我好像用了背景还是什么,然后调了一下间距
2017年04月24日 11点04分
1