OP와 마찬가지로 (ViewPager with Google Maps API v2: mysterious black view), 블랙은 ListView와 통합 될 때 부분적으로 만이 아니라 모든지도를 지배합니다. 나는이 주제가이 부분을 창조하는데 어떤 역할을한다고 생각하지 않는다. 그 OP의 답변을 통합하려 할 때, 전체 조각이 검은 색 공백으로 변했습니다.Google지도 v2 셜록과리스트 뷰가있는 검은 색 화면
누군가 내 조각을보고이 오류를 알아내는 데 도움이 되겠습니까?
감사합니다.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
class="com.google.android.gms.maps.SupportMapFragment" />
<ListView
android:id="@+id/map_frag_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
내 조각은 다음과 같습니다
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
//Checks if GooglePlayService is On--> Should take this out once first check forces user to have it
boolean ifPlay = MainActivity.getInstance().checkIfGooglePlay();
if(ifPlay) {
if (mapFragView != null) {
ViewGroup parent = (ViewGroup) mapFragView.getParent();
if (parent != null)
parent.removeView(mapFragView);
}
try {
mapFragView = inflater.inflate(R.layout.maptab, null, false);
} catch (InflateException e) {
/* map is already there, just return view as it is */
}
}
//Creating MapFragment from SharedPreferences recently stored information
SharedPreferences tmpManager = MainActivity.getInstance().prefs;
String recWordAssoc = tmpManager.getString("wordAssociations", "default");
//Building list
String[] theList = buildList(recWordAssoc);
assocListView = (ListView) mapFragView.findViewById(R.id.map_frag_view);
if(theList==null) {
theList = new String[0];
}
mapAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, theList);
assocListView.setAdapter(mapAdapter);
((BaseAdapter) assocListView.getAdapter()).notifyDataSetChanged();
if(mapFragView != null) {
setMapTransparent((ViewGroup)mapFragView);
return mapFragView;
}
((ViewGroup) assocListView.getParent()).removeView(assocListView);
container.addView(assocListView);
container.addView(mapFragView);
setMapTransparent(container);
return container;
}
검은 색 표면보기를 만들기 위해이 대체 클래스를 사용할 수 있습니다 : http://code.google.com/p/gmaps-api-issues/issues/detail? id = 4659 그리고이 문제에 대해 투표하십시오. 더 빨리 해결 될 것입니다. –
안녕하세요 @StephaneMathis, 나는 ObservableScrollView를 사용하려고하지 않으므로 Greg의 솔루션이 적용되지 않는다고 생각합니다. 감사합니다. – NumenorForLife
표면을 투명하게 만들려고 했습니까? –