android-tabhost

TabHost obtaining previous tab after a tab change

强颜欢笑 提交于 2019-12-13 02:14:58
问题 I have a TabHost and have set an onTabChangeListener. In onTabChange() is it possible to determine the previous tab? 回答1: Probably not, you'll have to store that information yourself. Just keep a record of previous tab in your class that listens for onTabChange() 来源: https://stackoverflow.com/questions/4307235/tabhost-obtaining-previous-tab-after-a-tab-change

Trying to open WebView in TabHost

和自甴很熟 提交于 2019-12-12 23:13:42
问题 Ok so i'm trying to create a small app that opens 3 different webviews within 3 different tabs. At the moment I Have my tabhost created ok and a separate class for my webview but when I open the app it doesn't display. Tabhost code public class HelloTabWidgetActivity extends TabActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Resources res = getResources(); // Resource object to get Drawables TabHost tabHost =

Why are the images in WidgetTab not shown if minSdkVersion>10?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 20:15:28
问题 I have been attempting to create a simple TabActivity with 3 Tabs. All works except if I put android:minSdkVersion="11" in the Manifest file, the icons are not shown. If I set `minSdkVersion="10", all is well. I have looked high and low, but I have not been able to determine what is wrong. I have put the same images in the seemingly appropriate resource directories: res/drawable-hdpi-v5 res/drawable-ldpi-v5 res/drawable-mdpi-v5 res/drawable-xhdpi-v5 And the the code is simple: import android

Android - Remove Icon from TabHost/TabWidget

我们两清 提交于 2019-12-12 18:33:22
问题 Is it possible to remove the icon (indicator) and the space between the text and the top of a Tab in a TabHost/TabWidget? I just want to diplay the text, but i can't. Thanks in advance. 回答1: Pass a TextView to setIndicator(View v) method with the associated text. If you want extensive styling, i suggest you pass your own "Tab" model as parameter instead. public class Tab extends LinearLayout { public Tab(Context c, int drawable, String label) { super(c); TextView tv = new TextView(c); tv

Webview in TabHost = Starting as black screen

血红的双手。 提交于 2019-12-12 14:48:08
问题 I'm trying to use a webview inside a tabhost that has 4 tabs - all linked to the same webview. This is great except for one problem: At start up the webview is black. Clicking tab 2,3 or 4 makes it "come alive". My quick fix was to use setCurrentTab(1) and then back to 0, but this looks ugly, so I figured I might as well ask for a solution as I cannot find anything online. How can this be fixed? Below is my XML: <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas

Tabhost nullpointerexception when tabhost isn't the only thing in the layout

 ̄綄美尐妖づ 提交于 2019-12-12 12:33:21
问题 I've noticed that there are numerous issues with using tabhost, but none of them really fit my issue. I am trying to create a view with an action bar on top, then a row of tabs under the bar. Here's my activity layout. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" style="@style/Dashboard"> <com.ftni.common.ui.ActionBar android:id="@+id/actionbar" style="

How to add images as a tab indicator in android tab host?

99封情书 提交于 2019-12-12 09:18:17
问题 I am currently developing an application which a tab host is shown, each one of tab in the tab host is an activity. Now, what I want to do is to replace my text tab indicator as an image. These are the code that I used for implementing my tab host activity. TabHostActivity: public class TabHostActivity extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tabhost); TabHost tabHost = (TabHost)

Vertical tabs in Android

落花浮王杯 提交于 2019-12-12 07:47:35
问题 I want to make vertical tabs in Android like below image. I had see example for vertical tabs from below link. Click here In this link answer has some comments and in comments they had share code but the link of mega-upload is expired. I had try many ways but not able to display tabs vertical. When I am trying according to link the tabs can not be display. Please help me 回答1: When I use tabs, I normally just hide the tabwidget tag by setting android visibility as gone. And add buttons to act

Android - iphone style tabhost [closed]

拥有回忆 提交于 2019-12-12 07:38:20
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Is it possible to style the Android Tabhost to look like that of the iPhone? If not, is there any open source code that can show how

Tab Dividers Not Showing In ICS

流过昼夜 提交于 2019-12-12 07:18:13
问题 I have a problem with .setDividerDrawable() only working in versions lower than Ice Cream Sandwich. When I run the emulator the tabs show perfectly, but no divider. When emulating lower versions of Android there is no problem, the dividers show. I am using this code for creating the TabHost. I have no clue on what it is that makes ICS flinch. manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sbl.mytabapp"