我想在一项活动中放置两个酒吧。首先,我想放置一个 TextView 控件开关,第二个放在 ListView 控件开关上。怎么做?我试图调整主标题栏,但我也有其他的。我放了两个样式文件,第一个包含控件TextView、ImageView和一个列表,第二个定义了单字段列表。
main_activity.xml
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".MainActivity" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:contentDescription="@string/desc"
android:src="@drawable/ic_launcher"
android:id="@+id/main" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/maine"
android:id="@+id/mainee"
android:textColor="#FFF"
android:textSize="22sp" />
<ListView
android:id="@+id/listView"
android:layout_marginTop="40dp"
android:background="@drawable/border_ui"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" >
</ListView>
</RelativeLayout>
行.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
<ImageView
android:id="@+id/countryFlag"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:contentDescription="@string/descCountryFlag"
android:gravity="center_vertical" />
<TextView
android:id="@+id/countryName"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:paddingLeft="60dp"
android:textColor="#000000"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/countryRate"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="5dp"
android:layout_marginRight="40dp"
android:layout_marginTop="5dp"
android:gravity="right"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="12sp" />
</FrameLayout>