android-tabs

Android does not show tabs

强颜欢笑 提交于 2020-01-17 13:52:28
问题 I am in a process of changing home activity to include tabs. I use https://github.com/saulmm/CoordinatorExamples as a source. For unknown reason I do not see the tabs in my AppBarLayout . I can see the Fragment content but tab headers are not displayed at all. I use appcompat-v7:23.3.0. Shortened layout: <android.support.design.widget.CoordinatorLayout <android.support.design.widget.AppBarLayout <android.support.design.widget.CollapsingToolbarLayout <ImageView .. <android.support.v7.widget

Tabs on a single page

前提是你 提交于 2020-01-17 03:37:12
问题 I'm currently using a ViewPager with a PagerTabStrip to display 4 tabs at the top of the device. All I want to do is have 4 tabs fixed in place and centered, but I can't figure out how to do that now that the old way (using Action bar tabs) has been deprecated. Basically I have something like this: But I want it so that all 4 of my tabs are on the same page (all visible). This is my code to set the pager adapter to the ViewPager : @Override protected void onCreate(Bundle savedInstanceState) {

Android Tab Layout inside Fragment

狂风中的少年 提交于 2020-01-13 14:59:34
问题 I have a main Activity with a navigation drawer and I'm trying to realize a layout like Play Music App with tabs. The MainActivity has a FrameLayout like a container: <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" /> and I want to put inside the @+id/container a Fragment with Tabs. How's the best way to do this? I thought I can create a MyFragment which extends Fragment and implements TabListener. The associated layout could

Android Tab Layout inside Fragment

我的未来我决定 提交于 2020-01-13 14:59:12
问题 I have a main Activity with a navigation drawer and I'm trying to realize a layout like Play Music App with tabs. The MainActivity has a FrameLayout like a container: <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" /> and I want to put inside the @+id/container a Fragment with Tabs. How's the best way to do this? I thought I can create a MyFragment which extends Fragment and implements TabListener. The associated layout could

Android Tabs in middle of layout

五迷三道 提交于 2020-01-11 06:32:30
问题 In the middle of my layout I want to have 2 tabs to choose between viewing 2 different lists in the second half of the screen. How can I do this? Here is an image illustrating what I wish to achieve. This image has a questions tab and an answers tab in the middle of the screen. Depending on which tab you select it shows a different listview: I wish to achieve this exact same thing. I tried doing it with TabHost widget, but for the life of me I couldn't get rid of the title bar (I tried

android center align the selected tab in tablayout

与世无争的帅哥 提交于 2020-01-09 05:18:16
问题 I am using android support design tablayout. Here's my code: <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content"" app:tabGravity="center" app:tabMode="scrollable" /> <android.support.v4.view.ViewPager android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="match_parent" /> My issue is the tabs always align left. However, I would like to center the selected tab (even at the

FragmentTabHost content filling remaining space

自古美人都是妖i 提交于 2020-01-06 07:38:10
问题 I've been experimenting with tab navigation on android but I can't set up the content area correctly. The layout of the application: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tabhost" android:tag="tabhost" android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android

Tab bar not showing when call new activity

只谈情不闲聊 提交于 2020-01-06 04:26:04
问题 My code View view = getLocalActivityManager().startActivity("main_jobs", new Intent(context,Job_Description.class) .putExtra("line", str_line).putExtra("limit",str_limit) .putExtra("limit",""+0) .putExtra("Alert", false) .putExtra("str_location", str_loc) .putExtra("str_Descrption",str_descjob) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)) .getDecorView(); setContentView(view); I am using this code to open new activity with tab but tab bar not showing and not any error get please help me how we

ActionBar Dynamic Tab Text Color Change

梦想与她 提交于 2020-01-04 09:55:41
问题 I need to change the tab text color dynamically. When the tab is selected text should be yellow and when unselected it should be black. I tried some tricks, but all I achieved was to change the ActionBar title color... My Java code setting up the tabs: private void setSortTabs() { //getting the action bar from the MainActivity final ActionBar actionBar = ((ActionBarActivity) getActivity()).getSupportActionBar(); //adding tabs to the action bar actionBar.setNavigationMode(ActionBar.NAVIGATION

android Navigation Tabs in middle of screen

早过忘川 提交于 2020-01-04 03:38:06
问题 In my app i want to have tabs in the middle of the screen and a gMap at the top is there anyway to position the tabs in the middle of the screen? Here is a raw design (source: qnex.me) 回答1: You can use ViewPagerIndicator library (using TabPageIndicator control) with a ViewPager control, and these are completely separate from the ActionBar and can be positioned anywhere you like. Download the source and check out the sample app. The code is very straightforward. Here's an example straight from