Monday, December 19, 2011

Android Tab Navigation Bar

Android Tab Navigation Bar  Example;

android tab host navigation bar  example  look like iphone navigation bar.

it's very usefull for page navigation very easyly and you can inside tabview GroupActivity.
adding tab to tab host;

  Drawable d = getResources().getDrawable(R.drawable.setting_onclick);
        ImageView img1 = new ImageView(this);
        img1.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,    LayoutParams.FILL_PARENT));
        img1.setPadding(20, 10, 20, 10);
        img1.setImageDrawable(d);
        homeTabSpec.setIndicator(img1).setContent(mainActivity);
       
        d = getResources().getDrawable(R.drawable.setting_onclick);
        img1 = new ImageView(this);
        img1.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        img1.setImageDrawable(d);
        img1.setPadding(20, 10, 20, 10);
        signinTabSpec.setIndicator(img1).setContent(mainActivity1);

       tabHost.addTab(homeTabSpec);
        tabHost.addTab(signinTabSpec);

style for onpress tab.
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
   <item android:state_selected="false" android:drawable="@drawable/settingstrans"/>
   <item android:state_selected="true" android:drawable="@drawable/settings_onclick"  />
</selector>



dowload source code here

7 comments:

  1. Thx Vijay. I was looking such in my next project.

    ReplyDelete
  2. Thx Vijay. I was looking such in my next project.

    ReplyDelete
  3. bro i want to code of this application .....

    ReplyDelete
  4. Hey just wanted to give you a quick heads up and let you know a few of the images aren't loading correctly. I'm not sure why but I think its a linking issue.
    I've tried it in two different browsers and both show the same outcome.

    Take a look at my site; cash advance form

    ReplyDelete
  5. I every time used to read paragraph in news papers
    but now as I am a user of web therefore from now I am using net for articles or reviews,
    thanks to web.

    Here is my page ... I agree with that

    ReplyDelete

Check out this may be help you

Related Posts Plugin for WordPress, Blogger...