Hey i wanna make specific single item row for my listView but don't know exacly how to handle it.
i.stack.imgur.com/9fUmX.png
I made something like this using weights on linear layout but it's not working correctly when additional info is too long.
i.stack.imgur.com/uG43j.png
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#55000000" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:orientation="horizontal"
android:weightSum="10" >
<!-- pomysle jeszcze nad wagami -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="2" >
<RelativeLayout
android:layout_width="60dp"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<TextView
android:id="#+id/JsonItemDataNumberOfTheDayFree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="21"
android:textColor="#FFF"
android:textSize="15sp" />
<TextView
android:id="#+id/JsonItemDataMonthFree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/JsonItemDataNumberOfTheDayFree"
android:layout_centerHorizontal="true"
android:text="CZE"
android:textColor="#FFF"
android:textSize="13sp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="7"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- tu nie jestem pewny margin top? -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/JsonItemTitleEventFree"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:singleLine="true"
android:text="Title"
android:textColor="#android:color/white"
android:textSize="18sp" />
<TextView
android:id="#+id/JsonItemAdditionalInfoFree"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="Additional Info"
android:textColor="#android:color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/JsonItemDateFree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dp"
android:text="Date"
android:textColor="#android:color/white"
android:textSize="10sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="100dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/JsonItemLogoCategoryFree"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/category_music"
android:scaleType="fitStart" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
try this
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#55000000"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="2" >
<RelativeLayout
android:layout_width="60dp"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<TextView
android:id="#+id/JsonItemDataNumberOfTheDayFree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="21"
android:textColor="#FFF"
android:textSize="15sp" />
<TextView
android:id="#+id/JsonItemDataMonthFree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/JsonItemDataNumberOfTheDayFree"
android:layout_centerHorizontal="true"
android:text="CZE"
android:textColor="#FFF"
android:textSize="13sp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="7"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_gravity="top"
android:id="#+id/JsonItemTitleEventFree"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:singleLine="true"
android:text="Title"
android:textColor="#android:color/white"
android:textSize="18sp" />
<TextView
android:id="#+id/JsonItemAdditionalInfoFree"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="Additional Info"
android:textColor="#android:color/white"
android:textSize="14sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/JsonItemDateFree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dp"
android:text="Date"
android:textColor="#android:color/white"
android:textSize="10sp" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="100dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/JsonItemLogoCategoryFree"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/category_music"
android:scaleType="fitStart" />
</LinearLayout>
Related
Following is my xml layout.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EBEBEB">
<ImageView
android:layout_width="wrap_content"
android:layout_marginTop="10dp"
android:layout_height="30dp"
android:src="#drawable/contact_us"/>
<TextView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="left"
android:text="Contact us"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/vai" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imageView"
android:layout_toLeftOf="#+id/imageView"
android:orientation="vertical">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Worldwide"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="48dp"
android:layout_marginStart="48dp"
android:text="Version 1.0"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#bdb9b8">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="Group of Companies"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_marginLeft="3dp"
android:layout_height="120dp"></android.support.v4.view.ViewPager>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#bdb9b8">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="Global Representativess"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager2"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_marginLeft="3dp"
android:layout_height="wrap_content"></android.support.v4.view.ViewPager>
<LinearLayout
android:id="#+id/last"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
</LinearLayout>
</LinearLayout>
The problem with my layout is that,
The linearlayout of id last is not fully visible.
I tried to encapsulate the entire layout within scrollview but if i do so , the second view pager is not getting visible. Is there any alternative to overcome this scenario?
Try to give Orientation to your Linear Layout. and Define it above your second View Pager your last Linear Layout. I have applied some changes to your Layout.
Refer this.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EBEBEB">
<ImageView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:gravity="left"
android:text="Contact us"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imageView"
android:layout_toLeftOf="#+id/imageView"
android:orientation="vertical">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Worldwide"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="48dp"
android:layout_marginStart="48dp"
android:text="Version 1.0"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#bdb9b8">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="Group of Companies"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="10dp"></android.support.v4.view.ViewPager>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#bdb9b8">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="Global Representativess"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:id="#+id/last"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:weightSum="6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="AgroProducts"
android:textColor="#000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="AgroProducts"
android:textColor="#000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="AgroProducts"
android:textColor="#000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="AgroProducts"
android:textColor="#000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="AgroProducts"
android:textColor="#000000" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="AgroProducts"
android:textColor="#000000" />
</LinearLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginTop="10dp"
android:orientation="vertical"></android.support.v4.view.ViewPager>
</LinearLayout>
There is no enough space to show this layout.
if you don't use you may have to add
android:weight sum to the container layout(the biggest one)
android:weightSum="3" (for example)
Then give each child layout the value you want, but make sure the summation of all values equels the weightsum
android:layout_weight="1" (for example)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="5"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2">
< TextView />
< TextView />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#bdb9b8"
android:layout_weight="2">
<TextView/>
<TextView/>
</LinearLayout>
<LinearLayout>
Or you can use ScrollView:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EBEBEB">
<ImageView
android:layout_width="wrap_content"
android:layout_marginTop="10dp"
android:layout_height="30dp"/>
<TextView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="left"
android:text="Contact us"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/imageView"
android:orientation="vertical">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Worldwide"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="48dp"
android:layout_marginStart="48dp"
android:text="Version 1.0"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#bdb9b8">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="Group of Companies"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:layout_marginLeft="3dp"
android:layout_height="120dp"></android.support.v4.view.ViewPager>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#bdb9b8">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center"
android:text="Global Representativess"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager2"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_marginLeft="3dp"
android:layout_height="wrap_content"></android.support.v4.view.ViewPager>
<LinearLayout
android:id="#+id/last"
android:layout_weight="1"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_height="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AgroProducts" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
I did some changes to your code.
Check this below code :
Add ScrollView to your parent Linear layout and give layout_weight to child elements
<?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:orientation="vertical" >
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="none"
android:fillViewport="true"
android:isScrollContainer="true"
android:scrollbars="none" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="11" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#EBEBEB" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:src="#drawable/contact_us" />
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="10dp"
android:gravity="left"
android:text="Contact us"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/vai" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Worldwide"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="48dp"
android:layout_marginStart="48dp"
android:text="Version 1.0"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout >
</LinearLayout >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#bdb9b8" >
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Group of Companies"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout >
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="10dp"
android:layout_weight="3" >
</android.support.v4.view.ViewPager >
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#bdb9b8" >
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Global Representativess"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout >
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="10dp"
android:layout_weight="3" >
</android.support.v4.view.ViewPager >
<LinearLayout
android:id="#+id/last"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="6" >
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Agro-Products" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Agro-Products" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Agro-Products" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Agro-Products" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Agro-Products" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="Agro-Products" />
</LinearLayout >
</LinearLayout >
</ScrollView >
</LinearLayout >
I am trying to make a layout in which there are two main layouts.
One is an imageview and the second one is a scrollview. What I want is that the imageview is always kept on top of the scrollview. When I run the program the image goes back to the scrollview.
<?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="#android:color/white"
android:orientation="vertical" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/img_back"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="left|top"
android:layout_margin="10dp"
android:background="#android:color/black"
android:contentDescription="#null"
android:src="#drawable/back" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:scrollbars="none" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- Top linear layout -->
<LinearLayout
android:id="#+id/ll_above_map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="250dp" >
<com.shotwell.customviews.SmartViewPager
android:id="#+id/vp_slider"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/dots"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp" />
<!--
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="#null"
android:scaleType="centerCrop"
android:src="#drawable/bigimage" /
-->
>
<TextView
android:id="#+id/tv_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:text="Pan-Asian"
android:textColor="#android:color/white"
android:textSize="18sp"
android:textStyle="normal" />
<TextView
android:id="#+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#id/tv_subtitle"
android:layout_alignLeft="#id/tv_subtitle"
android:text="Oka"
android:textColor="#android:color/white"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#id/tv_subtitle"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/tv_subtitle"
android:background="#drawable/open_btn"
android:focusable="false"
android:gravity="center"
android:text="Open"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#878787" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="56"
android:textColor="#android:color/black"
android:visibility="gone" />
<RatingBar
android:id="#+id/rb_rating"
style="#style/StarRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:rating="5.0" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_desc_toggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Description"
android:textColor="#6A6A6A"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/dummy_list_text"
android:textColor="#color/dark_gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" >
</LinearLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/rl_map_holder"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_margin="10dp" >
<com.google.android.gms.maps.MapView
android:id="#+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="#+id/tv_full_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="FullScreen"
android:textColor="#android:color/black"
android:textStyle="bold" />
</RelativeLayout>
<!-- bottom layout -->
<LinearLayout
android:id="#+id/ll_below_map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_address_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="1dp"
android:text="Berlin Top, Fiapre Suryani"
android:textColor="#android:color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/tv_state_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="1dp"
android:text="Brong Afoo, Ghana"
android:textColor="#android:color/black"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Phone no: "
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 024133556677"
android:textColor="#android:color/black"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Email: "
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="abc#yahoo.com"
android:textColor="#android:color/black"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="URL: "
android:textColor="#android:color/black"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="www.newstate.com"
android:textColor="#android:color/black"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_container_facility"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_toggle_facilities"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Facilities"
android:textColor="#6A6A6A"
android:textSize="22sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/ll_facilities"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<!--
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/dummy_list_text"
android:textColor="#color/dark_gray" />
-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" >
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_container_hours"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:id="#+id/tv_toggle_timing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hours"
android:textColor="#6A6A6A"
android:textSize="22sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/ll_timings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="0dp"
android:background="#android:color/darker_gray" >
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>
It's the code of activity. which I am using. Resultant screen looks like this.
So in layouts it shows lines where I place my imageview but it won't show up.
I think maybe the scrollview is pushing back the imageview.
So how to put my imageview on top of the scrollview ?
Sorry for my english. I have background image, if keyboard show is resize background image. If keyboard not show evrithing work fine.
sorry obout image i have not 15 reputation
Its normal condition: image
Its if keyboard is show: image, background image is resize
Its if i in manifest i write adjustPan image
Bellow my xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:background="#9a5f35"
android:layout_height="50dp" >
<LinearLayout
android:id="#+id/edit_profile"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
</LinearLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:text="Получить бонус"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20sp" />
<RelativeLayout
android:id="#+id/backDd"
android:layout_width="100dp"
android:layout_height="50dp" >
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:src="#drawable/back_arraund" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<ScrollView
android:id="#+id/scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:fadingEdge="none" >
<ImageView
android:id="#+id/imageView21"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="#drawable/bg_shkaf" />
</ScrollView>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dp"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="1) Введите сумму вашего счета"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="2) Сгенерируйте код"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="3) Покажите код официанту"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="4) Получите бонус на счет"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
</LinearLayout>
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:gravity="center"
android:lineSpacingMultiplier="1.2"
android:text="Бонусы дают привликательную возможность\nполучть скидки и обменивать их на подарки\nот нашего кафе.Получайте как можно больше\nбонусов, для более ценных подарков"
android:textColor="#d2d3ce"
android:textSize="13dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:text="Введите сумму:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" >
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginRight="10dp"
android:background="#drawable/button_radius_get_bonus"
android:gravity="center_vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/summgrn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:hint="1200"
android:inputType="number"
android:maxLines="1"
android:maxLength="5"
android:background="#null"
android:textColor="#fff"
android:textColorHint="#91623f" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:layout_marginRight="20dp"
android:layout_weight="1"
android:text="грн."
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#fff"
android:textSize="20dp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="1dp"
android:text="и покажите официанту код"
android:textColor="#fff"
/>
<ImageView
android:id="#+id/registrationsdasdad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp"
android:src="#drawable/review_button"
android:visibility="invisible" />
<TextView
android:id="#+id/textView102"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="50dp"
android:layout_marginTop="1dp"
android:text="Мы очень старались - оцените нас!"
android:textColor="#fff"
android:visibility="invisible" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
<ImageView
android:id="#+id/imageView212"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:layout_marginTop="10dp"
android:visibility="invisible"
android:src="#drawable/image_8" />
<RelativeLayout
android:id="#+id/generateBonus"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="bottom"
android:background="#9a5f35"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Получить"
android:textColor="#fff"
android:textSize="20dp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
I have an aligning problem in my app. I want to create three section.
Top side is a menu, bottom side is a menu and a map section in the middle of the screen. But as you can see in the picture, I couldn't align second menu to the bottom of the screen
Here is my layout xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context="com.ufukugur.app.MainActivity"
android:background="#000">
<!-- menu on the top -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:id="#+id/ustMenu">
<TableRow
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="7" >
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="false"
android:gravity="left"
android:id="#+id/imgLogo"/>
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menunokta"
android:id="#+id/imgMenuNokta"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuNokta"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Sembol"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menucizgi"
android:id="#+id/imgMenuCizgi"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuCizgi"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Rota"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menubolge"
android:id="#+id/imgMenuBolge"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuBolge"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Bölge"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menunotam"
android:id="#+id/imgMenuNotam"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuNotam"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Notam"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menufir"
android:id="#+id/imgMenuFir"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuFir"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="FIR"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menutrafik"
android:id="#+id/imgMenuTrafik"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuTrafik"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Trafik"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
</TableRow>
</RelativeLayout>
<!-- map and other things middle of the screen -->
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="60dp"
android:layout_marginBottom="60dp"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_alignParentBottom="true" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="GPS bağlantısı sağlanıyor..."
android:id="#+id/textKonum"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:textColor="#ff0"
android:background="#color/black_overlay"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=""
android:id="#+id/textYakin"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:background="#color/black_overlay"/>
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="50dp"
android:clickable="true"
android:onClick="notamClicked"
android:src="#drawable/unlems"
android:id="#+id/imgNotam"/>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:layout_marginBottom="40dp"
android:clickable="false"
android:id="#+id/imageGSM"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/hats_basla"
android:clickable="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_marginTop="70dp"
android:id="#+id/imbKayit" />
<!-- bottom menu -->
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:weightSum="6" >
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menuharita"
android:id="#+id/imgMenuHarita"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuHarita"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Harita"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menuguncel"
android:id="#+id/imgMenuGuncel"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuGuncel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Güncelle"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menubilgi"
android:id="#+id/imgMenuBilgi"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuBilgi"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="HATS"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menuayarlar"
android:id="#+id/imgMenuAyarlar"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuAyarlar"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Ayarlar"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menuara"
android:id="#+id/imgMenuAra"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuAra"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Ara"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" >
<ImageView
android:layout_width="match_parent"
android:layout_height="36dp"
android:clickable="true"
android:onClick="menuHarita"
android:gravity="center_horizontal"
android:src="#drawable/menuradar"
android:id="#+id/imgMenuRadar"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgMenuRadar"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Meteo"
android:gravity="center_horizontal"
android:textColor="#fff" />
</RelativeLayout>
</TableRow>
</RelativeLayout>
You can try this modified layout, its entirely different from what you have created but results the same which probably you want.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- TOP SIDE MENU AND OTHER VIEWS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:clickable="true"
android:contentDescription="#null"
android:gravity="center_horizontal"
android:onClick="menuHarita"
android:src="#drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_gravity="center"
android:text="Img1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:clickable="true"
android:contentDescription="#null"
android:gravity="center_horizontal"
android:onClick="menuHarita"
android:src="#drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Img2"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</LinearLayout>
// ADD YOUR REMAINING VIEWS HERE..........
</LinearLayout>
<!-- MIDDLE LAYOUT MAP AND OTHER VIEW -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<fragment
android:id="#+id/mapView"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<TextView
android:id="#+id/firstTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GPS bağlantısı sağlanıyor..."
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"/>
<TextView
android:id="#+id/firstTextView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GPS bağlantısı sağlanıyor..."
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"/>
// ADD OTHER VIEWS HERE, BE CARE FULL THE PARENT LAYOUT IS RELATIVE LAYOUT
SO, ADD REMAINING THREE IMAGE VIEWS ACCORDINGLY......
</RelativeLayout>
<!-- LOWER LAYOUT AND OTHER VIEWS VIEWING HORIZONTALLY -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:clickable="true"
android:contentDescription="#null"
android:gravity="center_horizontal"
android:onClick="menuHarita"
android:src="#drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="img1"
android:layout_gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:clickable="true"
android:contentDescription="#null"
android:gravity="center_horizontal"
android:onClick="menuHarita"
android:src="#drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="img2"
android:layout_gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</LinearLayout>
// ADD OTHER VIEW HERE......
</LinearLayout>
</LinearLayout>
NOTE: You need to replace my id's and other resources with yours. Just to test whether this layout
works as per your requirement just copy and paste my layout and check. And make changes as per
your requirement.
<?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="#00b9e8"
android:orientation="vertical" >
<!-- <include layout="#layout/header" /> -->
<LinearLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:background="#ffffff"
android:gravity="center"
android:padding="5dp" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search Status"
android:textColor="#0060a4"
android:textSize="#dimen/font_15dp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:id="#+id/setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/settings" />
<ImageView
android:id="#+id/searchstatus_imgBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/back_icon" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="40dp" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.35"
android:background="#drawable/round_bg"
android:padding="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Status"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#0060a4"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_weight="0.65"
android:background="#drawable/round_bg"
android:gravity="center"
android:padding="8dp" >
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:gravity="center"
android:text="Accepted"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#0060a4"
android:textSize="20dp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="40dip"
android:layout_height="40dip"
android:paddingLeft="25dip" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="40dp" >
<LinearLayout
android:id="#+id/linearlayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.35"
android:background="#drawable/round_bg"
android:padding="10dp" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Reason"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#0060a4"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearlayout2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_weight="0.65"
android:background="#drawable/round_bg"
android:gravity="center"
android:padding="10dp" >
<TextView
android:id="#+id/reason"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#0060a4"
android:textSize="20dp" />
</LinearLayout>
</LinearLayout>
</LinearLayot>
This is my code i want to add one Footer but i am unable to do this i dont know why this Problem is coming even i have take relative layout then also its not working please tell me how add one footer plz Help
Try this method and better to use relative layout for this.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout
android:layout_alignParentTop="true"
android:layout_above="#+id/footer"
android:id="#+id/content"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#999"
android:layout_margin="4dp"
>
<TextView
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Content"
android:gravity="center"
android:padding="20dp"
android:textColor="#fff"
/>
</LinearLayout>
<LinearLayout
android:layout_alignParentBottom="true"
android:id="#+id/footer"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="FOOTER"
android:gravity="center"
android:padding="20dp"
android:textColor="#fff"
android:background="#666"
/>
</LinearLayout>
</RelativeLayout>
this will give like this .is that you want ?