android-tabs

ActionBar with navigation tabs changes height with screen orientation

ぐ巨炮叔叔 提交于 2019-12-17 18:28:02
问题 My goal is to increase the ActionBar height for portrait mode. I currently set android:actionBarSize in my Themes.xml. <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="DayTheme" parent="android:style/Theme.Holo.Light"> <item name="android:actionBarSize">@dimen/actionBarHeight</item> <item name="android:actionBarTabTextStyle">@style/tab_indicator_text_dark</item> </style> <style name="NightTheme" parent="android:style

How to customize individual tabs? (changing background color, indicator color and text color)

空扰寡人 提交于 2019-12-17 11:46:19
问题 In this link : How do I apply a style programmatically? Kevin Grant gave a explaination to this question my problem with his code is the context part. To be precise : ctv = new CustomView(context, R.attr.tabStyleAttr); In this code it says : context cannot be resolved to a variable I want to apply specific style to tabs and that's why setting theme doesn't work for me. Any alternative to my problem is welcome too of course. I try to change the background color, indicator color and text color

Getting DrawerLayout to Slide over the ActionBar

无人久伴 提交于 2019-12-17 10:18:05
问题 I have a sliding drawer menu in an activity, which has an actionbar with some tabs on it. I'd like to get the sliding drawer to slide over the tabs , not below them. This is what it looks like right now... Any ideas on how this could be done? Note: I understand that I might be breaking some conventions and UI patterns here, and if it does not work at all, I'll look at alternatives. But I'd like to get this working first. EDIT: See the below screen shot of the Google Play Music app that does

How to customize android tabs or background change?

回眸只為那壹抹淺笑 提交于 2019-12-17 09:41:52
问题 I am very new to android. Now I build a small application. I need to change the look and feel of android default look up in 2.2. So, here I try to change the background of the tabs. Can you help me to do that. I love the way using the xml/style. This is what I need that actual output. 回答1: Your Tab Host XML file TabHost <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent"

Scrollable tabs style in Android

怎甘沉沦 提交于 2019-12-14 02:02:01
问题 I'd like to implement a navigation with two layers of tabs, similar to this one: However I cannot find how to give scrollable tabs this appearance: centered title for the active tab, and the others pushed to the sides, without separator or underlining. I'm pretty sure I've seen this scrollable tabs style before, so I was wondering if it's just a setting or maybe a third party library. Could anyone help me with this ? Thank you. 回答1: Have a look at ViewPager 's PagerTitleStrip. That's what you

IllegalStateException: adapter's content without calling PagerAdapter#notifyDataSetChanged

大憨熊 提交于 2019-12-13 08:55:45
问题 I did search all the question related to this but could not find any solution here is my code. private Toolbar toolbar; private TabLayout tabLayout; private ViewPager viewPager; MyFragmentPagerAdapter pagerAdapter; ArrayList<String> titles = new ArrayList<String>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_scrollable_tabs); new JSONAsyncTask() .execute(My_Url); toolbar = (Toolbar) findViewById(R.id

nullpointer exception in setting up a tabhost at calling addTab( TabHost.TabSpec spec) method

我的梦境 提交于 2019-12-13 07:29:33
问题 this question is really wierd and driving me crazy. i can't get rid of the nullPointerException. my task is quite simple, just run a test on the tabhost. but now i'm not able to even create one tabhost! in order to ceate a tabhost, there some points i need to be careful with. first there must be a tabwidget with an id of "@android:id/tabs" and a framelayout of which the id is "@android:id/tabconent". i swear i do pay attention and you can see that in my codes below. and i read my articles

Activities vs Fragments

只谈情不闲聊 提交于 2019-12-13 04:42:33
问题 I'm trying to design an application where the main mode of navigation through the application's several primary screens uses Tabs. I've basically copied the approach shown in the tutorial here: http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/ However, on some of these screens there are clickable elements that are supposed to kick off a full-screen page (the tabs should no longer at the top of the page). I've been able to get this working by creating a new

android: getFragmentManager() returns null

放肆的年华 提交于 2019-12-12 16:09:55
问题 Edit: The problem is that the fragment is getting detached from the Activity. However, I don't know how to prevent this. I have an application that uses a tab bar. When one of the tabs is clicked it loads a list of topics in the space below the tab bar. One of the topics is 'Directions'. Upon clicking this the space is now replaced with a layout that has another bar at the top (below the tab bar) that includes a 'Back' button and a 'Get Directions' button. Below that bar is a google map of

ActionBar tab styles in horizontal view

∥☆過路亽.° 提交于 2019-12-12 14:23:32
问题 When using a phone or a tablet in portrait mode, tabs are shown under the ActionBar that constains the logo and menu items. On tablets in horizontal mode they are shown inline with the logo and menu items. In this configuration the underscore under the seleced tab is lost. What style controls this? In portrait mode I want to use a different selected style than in landscape mode when tabs are shown inline with the logo and menu. My theme has it's parent set to Theme.AppCompat.Light . Under it