TextView is not displaying on the top of the screen
这是我的代码
<?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="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity" >
<TextView
android:id="@+id/distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
<RadioGroup
android:id="@+id/rg_modes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_driving"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/str_rb_driving" />
<RadioButton
android:id="@+id/rb_walking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str_rb_walking" />
<RadioButton
android:id="@+id/tv_distance_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="distance" />
</RadioGroup>
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_above="@id/rg_modes" />
</RelativeLayout>
最佳答案
添加 android:layout_below="@+id/distance"
作为属性 Fragment
xml 如下...
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_above="@id/rg_modes"
android:layout_below="@+id/distance" />
关于android - TextView 未显示在 Google map 的顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22188747/