Reputation: 629
friend's, i have a problem in setting height of layout,i have three layout with seperate xml layout,
1.header.xml it have an textview 2.main.xml have frmelayout with listview
3.content.xml
it have field to bind in framelayout listview.
here my code for getting solution
Actually i'm facing problem here isi have gallery of menus in header ,whrn iplace this gallery view below header i'm getting it with hidded below half of the gallery,because the height of header can't being changed in any sense,
here the code for header.xml
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:background="@drawable/gradient_black"
android:layout_gravity="center_horizontal" android:layout_width="fill_parent"
android:orientation="horizontal">
<ImageView android:src="@drawable/image_button1" android:id="@+id/back"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"/>
<TextView android:id="@+id/header_text1" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/back"
android:textSize="20sp" android:textStyle="bold" android:textColor="@color/white"
android:layout_marginLeft="60dip" android:layout_centerVertical="true"
android:layout_centerHorizontal="true" android:ellipsize="end"
android:singleLine="true" />
<ImageView android:src="@drawable/image_button" android:id="@+id/share"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@+id/header_text1" android:paddingTop="10dip"
android:paddingLeft="50dip" />
<Gallery android:id="@+id/gv" android:layout_width="fill_parent" android:paddingTop="0dip"
android:layout_height="fill_parent" android:spacing="15dip"
android:layout_below="@+id/back"
android:gravity="bottom" android:paddingBottom="0dip"/>
</RelativeLayout>
here the code for main.xml it have an FrameLayout have listview,have tab host and linearlayout at top
<?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"
android:layout_height="fill_parent">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="200dip" android:id="@+id/main_lay">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="100dip"
android:layout_marginTop="100dip">
<ListView android:id="@+id/content_listview"
android:layout_width="fill_parent" android:layout_height="340dip" />
</FrameLayout>
.
.
.
</LinearLayout>
----
</TabHost>
==================== code for list content field
it have linerlayout with three field to set on list...
===== here code for my activity
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.header);
. ;.---- help me get the clear view of gallery in header without hidding at bottom or simply how can i increase height of header layout.
Upvotes: 0
Views: 1000
Reputation: 57672
@MGSenthil: everybody was once new here. Simply work with and not against us :)
Back to topic: What do you mean with because the height of header can't being changed in any sense
? Please clarify if you cant change the height because it didnt work or if you cant change it because it has to be this size?!
If you want to have this header with a specific size, you should consider to remove something of the content so it fits.
I never used a custom title, but you should check if its not better to request NO_TITLE
and simply add your header to the main.xml
layout? You should be able to increase the height of your header that way.
Upvotes: 1
Reputation: 3452
As WarrenFaith said, we can't help you without the XML code. The basic answer with the informations you gave is layout_height but you can have set fill_parent and layout_weight to other fields and it would not be the same. Please provide some code
Upvotes: 2