android-tabs

Android Actionbar Sherlock with Tabs

牧云@^-^@ 提交于 2019-11-29 22:39:48
I am trying to implement ActionBar Sherlock with Tabs below that as shown in the above wire-frame. Should i use TabActivity ? - since i saw that it is deprecated. Which is the best way to achieve the same. Matt Handy I implemented this functionality with a SherlockFragmentActivity as tabview container and with SherlockFragment as tabs. Here is a sketch (I omitted the usual Android activity stuff): This is the tabview activity with two tabs: public class TabViewActivity extends SherlockFragmentActivity { // store the active tab here public static String ACTIVE_TAB = "activeTab"; @Override

Android, Tabs without Actionbar

风格不统一 提交于 2019-11-29 22:35:36
This question has been asked (for example, here Using ViewPager with Tabs without actionBar ), however the answer there doesn't work. There's some links to Swipey but unfortunately the link is broken too. The example from Android site EffectiveNavigation uses Actionbar to host the tab fragment, so obviously if I set a .NoActionBar theme, then there's no host. Any different way? Thanks. Update screenshot of what I want to create, at the top, there's no actionbar. Update 2 this is from the google example, there's an actionbar on top (titled "Effective navigation), which I want to get rid of

What event is triggered when a tab fragment is selected

被刻印的时光 ゝ 提交于 2019-11-29 17:01:32
问题 I'm using tab fragments in an activity and the actionbar hosts the tabs. What I want to do is that whenever a fragment appears (or re-appears) in the view (selected by the user), I start doing something. I cannot use onResume of the fragment in this case, since all tabs are never really 'paused' when the user selects another tab, so onResume is not called I can use the two following events from the hosting activity, but I don't want them since I expect the fragment should know this logic on

put tabs in the bottom of screen

一曲冷凌霜 提交于 2019-11-29 17:00:28
问题 I want to put tabs at the bottom part of my screen . For this purpose I have the following code : package info.androidhive.tabsswipe; import info.androidhive.tabsswipe.adapter.TabsPagerAdapter; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.FragmentTransaction; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; public class MainActivity extends FragmentActivity implements ActionBar.TabListener

Using Sliding Tabs with Toolbar

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 12:30:20
I've started to change from using ActionBarActivity to AppCompatActivity , but I've also started using the Toolbar as well instead of a standard ActionBar . However, in one of my activities which has a swiping tab type of layout, the following line seems to be deprecated: actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); Although I have looked at some other answers on Stack Overflow regarding this, is there any built-in way of changing this to support using the Toolbar . If so, could you explain exactly how I would go about changing it? How would deprecated methods like

ActionBar Tabs with multiple fragments

自古美人都是妖i 提交于 2019-11-29 12:21:53
问题 I've been trying to update my app and get going with fragments, the action bar, and all the other UI features that I'm missing out on. I understand I can have multiple fragments in an activity, have different layouts based upon the device and all that good stuff but I'm struggling with getting some tab stuff the way I want. I understand how to add tabs, switching between them but how do I have more than one fragment in a tab? So for example I have essentially two screens I want the user to be

How to refresh a Fragment of a FragmentPagerAdapter?

我的梦境 提交于 2019-11-29 12:05:00
问题 I have got 2 tabs called tab1 (home) and tab2 (profile) using TabPageIndicator and FragmentPagerAdapter libraries. In tab2, I have a button named "Log in" (tab2 inflates abc.xml ). When users click "log in" button, the app will show a login form in a new activity. After logging in, the activity finishes and the content view of tab2 will change ( it shows user's profile because it will inflate xyz.xml ). How can I do that? public class MainActivity extends SherlockFragmentActivity { private

Android TabHost deprecated

假装没事ソ 提交于 2019-11-29 10:36:40
问题 I am creating application which will support Android 2.2 to Android 4.1 . The TabHost is deprecated in Android version 3.2 . But the created application supported in all the versions . But I want to create the Tab bar application which will look like a tab bar in Android 4.1 while running the application in Android 4.2 , If I am running the application in below android 3.2 version device, it must look like the tab bar in that device. How can I do this.? 回答1: There are many points to your

FragmentTabHost bottom TabWidget

天大地大妈咪最大 提交于 2019-11-29 05:19:54
Hello How I can create bottom TabWidget in FragmentTabHost ? My xml looks line this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <FrameLayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="fill_parent" /> </FrameLayout> <TabWidget android:id="@android:id/tabs" android:layout_width="match_parent"

How to implement horizontally scrollable tabs?

喜你入骨 提交于 2019-11-29 04:51:45
问题 I'm trying to implement this application. At the moment I have designed tabs on it and since I have more than 7 tabs it looks too congested. How can I design it so that the tabwidget is scrollable horizontally. I have seen this design on few of the apps at the market but no clue how to implement this in my app. One app I saw had a horizontal scrollview where it scrolls on its own and when you press the particular image/button it displays some content. It didn't seem to be tabs I guess. So