如何在android的地图视图中显示按钮
在我的应用程序中,我正在使用视图翻转器。翻转的一侧我放置了一些文本并编辑文本视图。在翻转的另一部分,我有地图视图 为了在这两个视图之间切换,我使用了滑动的概念。我可以从文本视图滑动到地图视图。但是为了从视图返回文本页面,我决定在地图视图中的中放置一个按钮,但是按钮仍然不可见 下面是我的视图翻转器布局如何在android的地图视图中显示按钮,android,google-maps,button,Android,Google Maps,Button,在我的应用程序中,我正在使用视图翻转器。翻转的一侧我放置了一些文本并编辑文本视图。在翻转的另一部分,我有地图视图 为了在这两个视图之间切换,我使用了滑动的概念。我可以从文本视图滑动到地图视图。但是为了从视图返回文本页面,我决定在地图视图中的中放置一个按钮,但是按钮仍然不可见 下面是我的视图翻转器布局 <ViewFlipper android:background="#000000" android:layout_width="fill_parent" android:layout_hei
<ViewFlipper android:background="#000000" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/viewFlipper1">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginTop="25dip"
android:layout_marginBottom="10dip">
<TextView android:id="@+id/distance" android:text="0.0" android:textColor="#ffffff"
android:layout_width="80dip" android:layout_height="wrap_content"
android:gravity="center_vertical|right" android:layout_marginLeft="18dip"
android:textSize="20dip">
</TextView>
<Spinner android:id="@+id/unitspinner" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:drawSelectorOnTop="true"
android:prompt="@string/unit_prompt"/>
</LinearLayout>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.google.android.maps.MapView android:id="@+id/mapView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:enabled="true"
android:clickable="true" android:apiKey="0XXXXXXXXXXXXXXXXXXXX">
<Button android:id="@+id/widget306" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Back">
</Button>
</com.google.android.maps.MapView>
<LinearLayout android:id="@+id/zoom" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_centerHorizontal="true">
</LinearLayout>
</LinearLayout>
</ViewFlipper>
如何使按钮可见。请帮助我……按钮仅在相对布局中可见。xml文件必须如下所示
?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_main"
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="0y6Hyjz6Kxo-NOV_9KHYF7-ECYeGt99xeyVU3IQ"/>
<Button
android:id="@+id/select_3"
android:layout_marginTop="13dp"
android:layout_height = "wrap_content"
android:layout_width = "wrap_content"
android:onClick="selfSelectCenterLocation">
</Button>
</RelativeLayout>
?xml version=“1.0”encoding=“utf-8”>
上面的布局中没有按钮。您是否以编程方式添加按钮?@Femi->抱歉,我遗漏了布局文件的某些部分。现在我已经添加了完整的文件。。。。