【发布时间】:2019-02-20 16:42:47
【问题描述】:
我在 Android Studio 平台上的预览设计有问题。
我将附上两张照片:
设计师:here
我的手机:here
问题是 Android Studio 上的预览与我的手机显示的内容不完全相同。您肯定可以看到我的手机上没有显示描述字段。
XML 代码-sn-p 如下:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<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"
tools:context=".MainActivity">
<ImageView
android:id="@+id/yoyaku_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/yoyakulogo2" />
<android.support.v7.widget.LinearLayoutCompat
android:id="@+id/linear_layout_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/yoyaku_image"
android:orientation="horizontal">
<TextView
android:id="@+id/phone_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:layout_marginTop="8dip"
android:text="Phone number:" />
<TextView
android:id="@+id/actual_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:layout_marginTop="8dip"
android:text="076767674764764" />
</android.support.v7.widget.LinearLayoutCompat>
<android.support.v7.widget.LinearLayoutCompat
android:id="@+id/linear_layout_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linear_layout_1"
android:orientation="horizontal">
<TextView
android:id="@+id/location_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:layout_marginTop="8dip"
android:text="Location:" />
<TextView
android:id="@+id/location_view_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:layout_marginTop="8dip"
android:text="74 rue des cascades 75020 Paris " />
</android.support.v7.widget.LinearLayoutCompat>
<android.support.v7.widget.LinearLayoutCompat
android:id="@+id/linear_layout_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linear_layout_2"
android:orientation="horizontal">
<TextView
android:id="@+id/description_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:layout_marginTop="8dip"
android:text="Description:" />
<TextView
android:id="@+id/description_view_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:layout_marginTop="8dip"
android:text=" record storespecialized in Electronic Music based in Paris" />
</android.support.v7.widget.LinearLayoutCompat>
</RelativeLayout>
可以使用 ScrollView 解决问题,但最初我不想使用它。
这是什么原因造成的?
【问题讨论】:
标签: android android-linearlayout android-relativelayout