이제 탭은 http://susemi99.kr/3399 이걸로 하는게 좋다.
=================
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
이걸 이용해서 플레이 스토어처럼 탭을 넣었는데, 아래와 같은 메시지가 떴다.
The field ActionBar.NAVIGATION_MODE_TABS is deprecated
들어간지 얼마되지도 않았는데, 벌써 depreated가 되다니…
그래서 찾아보니 http://codetheory.in/android-pagertabstrip-pagertitlestrip-viewpager/ 이 블로그가 나와서 따라해보니 일단 warning은 안 뜬다.
하지만 모양이 플레이스토어처럼 한 화면에 많이 나오는건 아니더라.
<android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content" > <android.support.v4.view.PagerTabStrip android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#f00" android:paddingBottom="10dp" android:paddingTop="10dp" android:textColor="#0ff" /> </android.support.v4.view.ViewPager>
<android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content" > <android.support.v4.view.PagerTitleStrip android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#f00" android:paddingBottom="10dp" android:paddingTop="10dp" android:textColor="#0ff" /> </android.support.v4.view.ViewPager>
소스는 https://github.com/susemi99/PagerTagStrip 에 있다.