Android 我想让第1层去美国

Android 我想让第1层去美国,android,Android,嗨,伙计们 我发布了我的问题,但是我得到的答案不正确 我只想让第1层进入状态1,但它不工作 我希望你能帮我编辑代码,因为我是初学者 这是密码 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight" andr

嗨,伙计们

我发布了我的问题,但是我得到的答案不正确

我只想让第1层进入状态1,但它不工作

我希望你能帮我编辑代码,因为我是初学者

这是密码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip" >


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip" >

<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/secondLine"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:text="@string/state1"
android:textSize="16sp" />


<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/sayer1"
android:textSize="12sp" />

</RelativeLayout>

试试这个代码。它会对你有用的

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip" >

<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/secondLine"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:text="@string/state1"
android:textSize="16sp" />


<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="@id/textView1"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/sayer1"
android:textSize="12sp" />

</RelativeLayout>

试试这个

如果您使用的是
RelativeLayout
请使用
android:layout_down=“@+id/textView1”
作为
第二行的
TextView

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip" >

<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="state1"
android:textSize="16sp" />


<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:layout_below="@+id/textView1"
android:ellipsize="marquee"
android:singleLine="true"
android:text="sayer1"
android:textSize="12sp" />

</RelativeLayout>

这是一篇重复的文章。。。。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:orientation="vertical"
android:padding="6dip" >

<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="state1"
android:textSize="16sp" />


<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:ellipsize="marquee"
android:singleLine="true"
android:text="sayer1"
android:textSize="12sp" />

</LinearLayout>