ActionBarSherlock과 함께 슬라이딩 메뉴를 사용 중이며 android google map v2를 조각에 표시해야합니다. 클래스는 SherlockFragment를 확장합니다. 어떻게해야합니까?Sliding 메뉴에서 Android Google Map V2를 조각으로 사용하는 방법은 무엇인가요?
2
A
답변
0
내 문제를 해결했습니다. https://stackoverflow.com/a/14768343/1276967 SherlockFragment와 함께 작동하지만 드물게 팽창 문제가 있습니다. 다른 문제로 인한 것일 수도 있습니다.
1
가장 좋은 방법은 SupportMapFragment
을 확장하고 거기에 모두 논리를 적용하는 것입니다.
그런 다음 당신은 단순히의 데이터 집합으로 FragmentPagerAdapter
를 사용하여 ViewPager
이 조각을 추가 할 수 있습니다
class FrgInfo {
Class clss;
Bundle args;
}
과 getItem
메서드를 재정의 :
@Override
public Fragment getItem(final int position) {
final FrgInfo info = fragments.get(position);
return Fragment.instantiate(context, info.clss.getName(), info.args);
}
이 트릭을 할해야합니다.