我是Android开发新手,我无法理解为什么它不按照所需的输出工作。
下面显示了所需的输出和输出以及ml布局。RelativeLayout或LinearLayout?
布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.caringhumans.rds.caringhumans.MainActivity">
<ImageView
android:id="@+id/logo"
android:src="@drawable/logo"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_toLeftOf="@+id/caring"/>
<TextView
android:id="@+id/caring"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Caring Humans"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="25sp"
android:textColor="#f70f59"/>
<ImageView
android:id="@+id/child"
android:src="@drawable/child"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/caring"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Campaign"
android:textColor="#f70f59"
android:textSize="22sp"
android:layout_below="@+id/child"/>
</RelativeLayout>
RelativeLayout,它将帮助您稍后支持多种屏幕尺寸 –