我跟着Hello Views, Google Map View,現在我想在MapView
的下面添加一個TextView
。我只更改了佈局文件main.xml
,並將MapView
和TextView
放置在垂直LinearLayout
中。我的Eclipse被設置爲自動生成,但是當我在模擬器中運行應用程序時,我只能看到MapView
。如何在MapView下添加TextView?
如何在MapView
下面添加TextView
?
這裏是我的佈局main.xml
:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="my key"
/>
<TextView
android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="My TextView"
/>
</LinearLayout>
謝謝,我在'MapView'(1.0)和'TextView'(0.0)上增加了一個權重,現在它工作。 – Jonas 2010-11-10 12:09:56