设计登录和注册页面采用了android标签 [英] Design Login and Register page using android tabs
问题描述
我想设计一个登录名和采用了android标签注册的布局。图像是如下所示。我如何进行
I want to design a login and register layout using android tabs. Image is as shown below. how do i proceed
推荐答案
我会使用Android API支持库和示例 FragmentTabsPager
位于<一个href=\"http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabsPager.html\" rel=\"nofollow\">http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabsPager.html
I would use the Android API Support Library and the sample FragmentTabsPager
located at http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabsPager.html
您将有两个选项卡,分别对应两个片段
,你能说出RegisterFragment和LoginFragment。
You would have two tabs, corresponding to two Fragments
that you could name RegisterFragment and LoginFragment.
基本上你会删除线
mTabsAdapter.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),
FragmentStackSupport.CountingFragment.class, null);
mTabsAdapter.addTab(mTabHost.newTabSpec("contacts").setIndicator("Contacts"),
LoaderCursorSupport.CursorLoaderListFragment.class, null);
mTabsAdapter.addTab(mTabHost.newTabSpec("custom").setIndicator("Custom"),
LoaderCustomSupport.AppListFragment.class, null);
mTabsAdapter.addTab(mTabHost.newTabSpec("throttle").setIndicator("Throttle"),
LoaderThrottleSupport.ThrottledLoaderListFragment.class, null);
和使用替代它们。
mTabsAdapter.addTab(mTabHost.newTabSpec("register").setIndicator("Register"),
RegisterFragment.class, null);
mTabsAdapter.addTab(mTabHost.newTabSpec("login").setIndicator("Login"),
LoginFragment.class, null);
然后你实现这些片段,这code集成到您的活动。你还需要将fragment_tabs_pager.xml布局集成到您的布局。
Then you implement those Fragments and integrate this code into your Activity. You'll also need to integrate the fragment_tabs_pager.xml layout into your layout.
这篇关于设计登录和注册页面采用了android标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!