Java Android SupportFragment隐藏警报对话框
我正在构建一个应用程序,使用Android maps v2片段,需要2.3支持。我已经将地图设置好并运行良好,但是我的AlertDialogs显示在地图片段下,我在片段上布置的按钮也没有显示。这只发生在2.3设备、4.0+设备上。AlertDialog显示时没有问题 下面是我如何创建AlertDialog的:Java Android SupportFragment隐藏警报对话框,java,android,android-fragments,android-support-library,Java,Android,Android Fragments,Android Support Library,我正在构建一个应用程序,使用Android maps v2片段,需要2.3支持。我已经将地图设置好并运行良好,但是我的AlertDialogs显示在地图片段下,我在片段上布置的按钮也没有显示。这只发生在2.3设备、4.0+设备上。AlertDialog显示时没有问题 下面是我如何创建AlertDialog的: AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage("Are you sure you the trip is finished?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {});
以下是我对相关屏幕的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ViewStub
android:id="@+id/stub_duty"
android:inflatedId="@+id/panel_duty"
android:layout="@layout/hud_duty"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_gravity="top" />
<ViewStub
android:id="@+id/stub_pickupHUD"
android:inflatedId="@+id/panel_pickupHUD"
android:layout="@layout/hud_pickup"
android:layout_weight="1.5"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_gravity="top" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_weight="7"
android:layout_height="0px"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<fragment
android:id="@+id/mapView"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="@+id/wayBillButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:src="@drawable/info_black"
android:layout_weight="1" />
</RelativeLayout>
</LinearLayout>
<ViewStub
android:id="@+id/stub_waiting_bottom"
android:inflatedId="@+id/panelWaitingBottom"
android:layout_weight="1"
android:layout="@layout/panel_driver_info_bottom"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_gravity="bottom" />
<ViewStub
android:id="@+id/stub_pickup_bottom"
android:inflatedId="@+id/panelPickupBottom"
android:layout_weight="2"
android:layout="@layout/panel_pickup_bottom"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_gravity="bottom" />
<ViewStub
android:id="@+id/stub_driving_bottom"
android:inflatedId="@+id/panelDrivingBottom"
android:layout_weight="2"
android:layout="@layout/panel_driving_bottom"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_gravity="bottom" />
我感谢你们在预付款方面的帮助,谢谢各位。你们有什么解决办法吗?我也面临同样的问题。