每当我在设计师界面上添加一个新的容器视图,并将
我该怎么解决这个问题? < p > < p > < code >content_main.xml的代码片段 编辑:可能与上面的图像略有不同,但仍然存在相同的问题。
layout:width
和layout:height
都设置为wrap_content
时,容器视图的大小超出了应有的范围,如下所示。我该怎么解决这个问题? < p > < p > < code >content_main.xml的代码片段 编辑:可能与上面的图像略有不同,但仍然存在相同的问题。
<?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: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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.dance2die.myapplication.MainActivity"
tools:showIn="@layout/activity_main">
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:padding="0dp" />
</RelativeLayout>