Tôi đang sử dụng SwipeyTabs
trong đơn đăng ký của mình. Tôi không chắc chắn cách điền nội dung tab. Nó thậm chí không có bất kỳ xml riêng.Android: Làm thế nào để điền vào SwipeyTabs?
Tôi đang sử dụng các tab như thế này:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_swipey_tabs);
initViewPager(4, 0xFFFFFFFF, 0xFF000000);
mSwipeyTabs = (SwipeyTabsView) findViewById(R.id.swipey_tabs);
mSwipeyTabsAdapter = new SwipeyTabsAdapter(this);
mSwipeyTabs.setAdapter(mSwipeyTabsAdapter);
mSwipeyTabs.setViewPager(mPager);
}
private void initViewPager(int pageCount, int backgroundColor, int textColor) {
mPager = (ViewPager) findViewById(R.id.pager);
mPagerAdapter = new ExamplePagerAdapter(this, pageCount, backgroundColor, textColor);
mPager.setAdapter(mPagerAdapter);
mPager.setCurrentItem(1);
mPager.setPageMargin(1);
}
Và đây là activity_swipey_tabs.xml
bố trí:
<android.ex.com.viewpager.extension.SwipeyTabsView
android:id="@+id/swipey_tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#3B3B3B" />
<View
android:id="@+id/colorline"
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_below="@+id/swipey_tabs"
android:background="#FF91A438" />
<View
android:id="@+id/blackline"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_below="@+id/colorline"
android:background="#FF000000" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/blackline" />
Có những ví dụ hoặc hướng dẫn?
Mọi hỗ trợ sẽ tuyệt vời.
http://stackoverflow.com/questions/10912602/swipeytabs-how-to-create-swipey-tabs-using-actionbarsherlock-library kiểm tra điều này –
Bạn chắc chắn đây là những gì tôi đang tìm kiếm? Nếu có, ví dụ làm thế nào tôi có thể đặt bất kỳ TextView hoặc người nghe sthelse? Btw cảm ơn. – Martin