我跟着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