I tried all the answers similar to that question on this website but still couldnt fix it. taphost is below the action bar and i wanna make it above the action bar. I have a custom action bar.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.mediamer.metwally.saidkotb.activities.makalatActivity"
android:layoutDirection="rtl"
android:orientation="vertical"
>
<TabHost
android:id="#android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0000"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TabWidget
android:id="#android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TabWidget>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
This is my custom action bar
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3"
>
<ImageView
android:layout_width="0dp"
android:layout_height="22dp"
android:src="#drawable/homebutton"
android:layout_gravity="center"
android:layout_weight="0.40"
android:id="#+id/homeButton"
/>
<Space
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.60"
/>
<com.mediamer.metwally.saidkotb.helpers.CustomTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#color/TextColor"
android:id="#+id/mytext"
android:textSize="25sp"
android:layout_weight="1"
/>
<Space
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.60"
/>
<android.support.v7.widget.SearchView
android:id="#+id/svZelal"
android:layout_width="0dp"
android:searchIcon="#android:drawable/ic_menu_search"
android:layout_height="match_parent"
android:layout_weight="0.40"
/>
</LinearLayout>
</LinearLayout>
Related
i have added footer in tab activity footer is shown in all tabs but problem is that it comes over the data so data at bottom is not visible.
here is my code of xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/relativ_layout"
tools:context=".MainActivity" >
<TabHost
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TabWidget
android:id="#android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ff8800"
android:orientation="horizontal" >
</TabWidget>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" >
</FrameLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
</android.support.v4.view.ViewPager>
</LinearLayout>
</TabHost>
// footer *************************************************
<RelativeLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#F00000"
android:gravity="bottom" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="Fixed Footer"
android:textColor="#000"
android:textSize="20sp" />
</RelativeLayout>
//********************************************
</RelativeLayout>
<FrameLayout
android:id="#+id/Frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
<LinearLayout
android:id="#+id/navigation_drawer"
android:layout_width="#dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
android:orientation="vertical"
android:background="#android:color/white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:clickable="true"
android:focusable="true"
android:background="#drawable/navigationdrawer"
>
<TextView
android:id="#+id/txtemail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Shivam1692#gmail.com"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"/>
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15dp"
android:paddingTop="20dp"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:paddingLeft="10dp"
android:paddingRight="16dp"
android:text="TITLE" />
<ListView
android:id="#+id/list_slider"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:listSelector="#drawable/list_selector"
android:divider="#color/list_divider"
android:choiceMode="singleChoice"
android:dividerHeight="0.3dp"
/>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
please tell me how to add footer below the data.
You can do this by using nested relative layouts, like below
<!-- Header -->
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="center" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Header"
android:id="#+id/textView" />
</RelativeLayout>
<!-- Footer -->
<RelativeLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Footer"
android:id="#+id/textView2" />
</RelativeLayout>
<!-- Content -->
<!-- Place your content in this layout-->
<RelativeLayout
android:id="#+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#id/footer"
android:layout_below="#id/header"
android:gravity="center" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Content"
android:id="#+id/textView4" />
</RelativeLayout>
Result: (Borders added for clarity)
enter code hereJust add a padding bottom 30dp[android:paddingbottom="30dp"] to the LinearLayout which you have used
Or
Change the LinearLayout to RelativeLayout and add android:layout_below="#id/footer"
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/relativ_layout"
tools:context=".MainActivity" >
<TabHost
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="30dp" >
I want to create this layout where there are three equal ImageViews in a linear layout with layout_weight = 1.0 each. I just want to put two circular images on the inner edges aligned center vertically in android. Maybe I cant achieve this in XML or maybe yes. Please help me achieving this properly.
Try this way,hope this will help you to solve your problem.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#android:color/white">
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#android:color/black">
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#android:color/white">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="right">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher"/>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="left">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_launcher"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
<?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"
android:orientation="vertical" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#123456"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#654321"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:src="#android:drawable/alert_dark_frame" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:src="#android:drawable/alert_light_frame" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>
I have an Activity that uses AndroidSlidingUpPanel. Now, everything works perfect. However, I would like to add a ScrollView on my second panel to add the same functionality like Maps or Google Music:
For instance,
When the user has a list of directions, he/she may pull up the drawer and scroll the complete instructions.
Now, my attempt:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<ScrollView
android:id="#+id/card_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<it.gmariotti.cardslib.library.view.CardView
android:id="#+id/food_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="12dp"
android:animateLayoutChanges="true" />
<View
android:layout_width="match_parent"
android:layout_height="15dp" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eee"
android:clickable="true"
android:focusable="false"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/name_slide"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:paddingLeft="10dp"
android:text="#string/slide_up"
android:textSize="14sp" />
</LinearLayout>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<it.gmariotti.cardslib.library.view.CardView
android:id="#+id/food_nutrition_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:animateLayoutChanges="true" />
<View
android:layout_width="match_parent"
android:layout_height="15dp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
This, displays fine my content, but does not add the scroll view for the second panel.
What can I do?
Note: According to the documentation of AndroidSlidingUpPanel, there can only be two children under its view. I use a LinearLayout as the second child because its the only way that I have found to display the drawer. For instance, that TextView would be in the place of the content of the estimated time (drawer) from Maps.
Thanks
Height of second scrollview should be android:layout_height="match_parent". Good luck!
take one RelativeLayout in com.sothree.slidinguppanel.SlidingUpPanelLayout and set property layout_above="yoursecondLinearlayout" to First ScrollView and second child LinearLayout to set property alignParentBottom=true. thats it....
See below code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
**<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >**
<ScrollView
android:id="#+id/card_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
**android:layout_above="#+id/linearlayout1"**>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<it.gmariotti.cardslib.library.view.CardView
android:id="#+id/food_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="12dp"
android:animateLayoutChanges="true" />
<View
android:layout_width="match_parent"
android:layout_height="15dp" />
</LinearLayout>
</ScrollView>
<LinearLayout
**android:id="#+id/linearlayout1"**
**android:layout_alignParentBottom="true"**
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eee"
android:clickable="true"
android:focusable="false"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/name_slide"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:paddingLeft="10dp"
android:text="#string/slide_up"
android:textSize="14sp" />
</LinearLayout>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<it.gmariotti.cardslib.library.view.CardView
android:id="#+id/food_nutrition_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:animateLayoutChanges="true" />
<View
android:layout_width="match_parent"
android:layout_height="15dp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
Fixed it by adding an id to the Parent of the Title, and adding this to my code:
layout.setDragView((LinearLayout) findViewById(R.id.scrolled_view));
New .xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<ScrollView
android:id="#+id/card_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<it.gmariotti.cardslib.library.view.CardView
android:id="#+id/food_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:layout_marginTop="12dp"
android:animateLayoutChanges="true" />
<View
android:layout_width="match_parent"
android:layout_height="15dp" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eee"
android:clickable="true"
android:focusable="false"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/scrolled_view"
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/name_slide"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:paddingLeft="10dp"
android:text="#string/slide_up"
android:textSize="14sp" />
</LinearLayout>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<it.gmariotti.cardslib.library.view.CardView
android:id="#+id/food_nutrition_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:animateLayoutChanges="true" />
<View
android:layout_width="match_parent"
android:layout_height="15dp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
i am developing application for tablet.i have xml file i put this files layout folder and layout-land folder in this xml i used framelayout including image view but when i run application image is not displayed.Could you tell me why image is not displayed.
i attached full source code of xml file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/frontbackground"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#color/header"
android:orientation="horizontal"
android:weightSum="3" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/navigation" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="2dp"
android:text="Kesari"
android:textColor="#color/textcolor"
android:textSize="14sp" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_weight="2"
android:text="Choose from the exciting holiday packages across 7 continents from world class travel company"
android:textColor="#color/textcolor"
android:textSize="14sp" />
</LinearLayout>
<TabHost
android:id="#android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="none">
<TabWidget
android:id="#android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TabWidget>
</HorizontalScrollView>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:orientation="vertical" >
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/linearLayout1" >
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab2"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab3"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab4"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab5"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab6"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab7"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
<FrameLayout
android:id="#+id/framelayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/ImageView01"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/malaysia1"></ImageView>
</FrameLayout>
</LinearLayout>
This must be because you have given height to tabHost as match_parent.Replace it with wrap_content and your imageView also use wrap_content for height.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#808285"
android:orientation="vertical">
<LinearLayout android:id="#+id/homeHeaderLayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="34dp"
android:background="#drawable/header_bg">
<ImageView android:id="#+id/searchImageView"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:background="#drawable/header_bg_states"
android:layout_gravity="center|center_vertical"
android:layout_weight="25"
android:scaleType="center"
android:src="#drawable/ic_search"/>
<View android:layout_height="match_parent"
android:layout_width="1.2dp"
android:background="#drawable/header_divider"/>
<ImageView android:id="#+id/headerLogo"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#drawable/header_bg_states"
android:layout_gravity="center|center_vertical"
android:layout_weight="50"
android:scaleType="center"
android:src="#drawable/madisons_logo"/>
<View android:layout_height="match_parent"
android:layout_width="1.2dp"
android:background="#drawable/header_divider"/>
<ImageView android:id="#+id/shoppingCartImageView"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:background="#drawable/header_bg_states"
android:layout_gravity="center|center_vertical"
android:layout_weight="25"
android:scaleType="center"
android:src="#drawable/ic_cart"/>
</LinearLayout>
<TabHost android:id="#android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<TabWidget android:id="#android:id/tabs"
android:layout_height="35dp"
android:layout_width="match_parent"
android:background="#drawable/tabs_bg"
android:gravity="center"
android:layout_gravity="center"
android:layout_marginTop="1dp"
android:orientation="vertical"
android:tabStripEnabled="true"
style="#style/TabText"/>
<View android:layout_height="0.5dp"
android:layout_width="match_parent"
android:background="#FFFFFF"/>
<FrameLayout android:id="#android:id/tabcontent"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="#FFFFFF"/>
</LinearLayout>
</TabHost>
Tabs are not coming in my device... but in emulator they are showing & working.
my requirement is is work in Google API2.2 version level_8
please anyone can tell me the solution for this