views:

318

answers:

1

Hi,

I'm new in android and I have few questions to ask.

  1. Is it possible to use the keypad (Left and Right) to move from one TabHost to another?

  2. I successfully changed the selector color in listview, then how can I change the text color in ListView as well?

  3. Is it possible change the TabHost layout by own graphics?

  4. I have created a TabHost aligned to the bottom of the screen. How can I move the "line" on bottom of TabWidget to above? (see screenshot)

alt text

Your reply is very appreciated. Thank you.

P/S: sorry about my bad english, hope you guys understand what I'm talking about. Thanks

A: 

Hi,
3/ yes it's possible and if you use your own graphics like this, you will have a picture insidetab

int tab_list_on;
private TabHost mTabHost;

mTabHost = getTabHost();

tab_list_on = R.drawable.onglet_480_liste;
TabImgFond1 = new ImageView(this, null, android.graphics.Typeface.NORMAL);
TabImgFond1.setImageResource(tab_list_on);

mTabHost.addTab(mTabHost.newTabSpec(TAB_LISTE).setIndicator(TabImgFond1).setContent(intentList));

mTabHost.setOnTabChangedListener(new OnTabChangeListener() {
    public void onTabChanged(String tabId) {
    TabChangedState(tabId);
    }
});
mTabHost.setCurrentTab(0);

1/you can try this, i'm not sure, but i think it's working, put this inside your class

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.i(TAG,"CODE : "+keyCode);
if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
    //TODO
    return true;
}
return false;
}
NSchubhan
Thanks NSchubhan, it work!!
WynixToo