EclipseプロジェクトをAndroid Studioにインポートし、com.google.android.gms.common.api.GoogleApiClientに更新しました。EclipseプロジェクトをStudioにインポート中に発生する
マイプロジェクトには、多くの断片が含まれている主なアクティビティが1つあります。ホームボタンの断片にはMapがあります。
private void addMap() {
FragmentManager fm = getChildFragmentManager();
if(isGoogleMapsInstalled())
{
if (fragment == null)
{
GoogleMapOptions op = new GoogleMapOptions();
op.zOrderOnTop(true);
op.zoomControlsEnabled(false);
fragment = MapFragment.newInstance(op);
fm.beginTransaction().replace(R.id.homemap_id, fragment).commit();
}
}else
{
Toast.makeText(getActivity(), "Please install google map", Toast.LENGTH_SHORT).show();
}
}
プロジェクトを正常に実行している場合、地図にはすべてのビューとボタンが隠れています。 MainActivityのMenu Sliderでもマップの下に表示されますが、オーバーマップからは動作し、マップは無効になります。
**編集::それはとても、アプリのGradleでコードの下に使用されるいくつかのメモリの問題が、運のbecozことができると思っていました。
multiDexEnabled true
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
この問題を解決するのに役立ちます。 **注::このコードはEclipseでうまくいきました。
編集::あなたの問題のために
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_texture_a"
android:orientation="vertical" >
<RelativeLayout android:id="@+id/map_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<FrameLayout
android:id="@+id/homemap_id"
android:background="@color/dark_red_text_trans"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
<CheckBox
android:id="@+id/traffic_heat_btn"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:layout_marginTop="70dp"
android:background="@drawable/selector_traffic_toggle"
android:button="@null"
android:checked="false"
android:scaleType="fitCenter" />
<TextView
android:id="@+id/mylocation_btn"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="10dp"
android:layout_marginBottom="70dp"
android:background="@drawable/selector_location_toggle"
android:button="@null"
android:scaleType="fitCenter" />
<HorizontalScrollView
android:id="@+id/box_horizonScroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:orientation="horizontal"
android:scrollbars="vertical"
android:visibility="gone" >
<!-- android:background="#aaffffff" -->
<LinearLayout
android:id="@+id/dependent_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
<LinearLayout
android:id="@+id/mask_bottom_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@color/dark_red_text"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingBottom="17dp"
android:paddingLeft="20dp"
android:paddingTop="17dp"
android:text="Cancel"
android:textColor="@color/white"
android:textSize="@dimen/text_sizes_smallest"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="DONE"
android:textColor="@color/white"
android:textSize="@dimen/text_sizes_medium"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingRight="15dp"
android:text="Clear Filters"
android:textColor="@color/white"
android:textSize="@dimen/text_sizes_smallest"
android:textStyle="bold"
android:visibility="visible" />
</LinearLayout>
</LinearLayout>
レイアウトXMLファイルを投稿できますか? – Raghavendra
xmlレイアウトに問題があるようです。問題の詳細については、ここにxmlファイルを投稿してください。 –
@Raghavendra xmlレイアウトも追加しました。それを見てください&任意の助けに感謝します。 – Deepak