Android XML problems with 3 linearlayouts - android

I have got some trouble with layouts inside my page. I want make a dialog with 6 radio buttons, ImageView, and 6 seekbars and confirm button. But if i add a button i can't see it. It allways samwhere disapiard.
Here is sampe, what i want to make:
http://prntscr.com/3ywtnt
I think the seekbars take over to much place and than button fall down ...
Here is code
<?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="vertical"
android:weightSum="8"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="4"
>
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RadioButton
android:id="#+id/blur"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Blur" />
<RadioButton
android:id="#+id/outer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Outer" />
<RadioButton
android:id="#+id/inner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Inner" />
<RadioButton
android:id="#+id/pencil"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pencil" />
<RadioButton
android:id="#+id/emboss"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Emboss" />
/>
</RadioGroup>
<ImageView
android:id="#+id/widthImageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="4"
>
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="false" >
<LinearLayout
android:id="#+id/linearLayoutSeekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="16" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2" >
<TextView
android:id="#+id/ime1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width" />
<TextView
android:id="#+id/vrednost1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
</LinearLayout>
<SeekBar
android:id="#+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
</LinearLayout>
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2" >
<TextView
android:id="#+id/ime3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
</LinearLayout>
<SeekBar
android:id="#+id/seekBar3"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2" >
<TextView
android:id="#+id/ime4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
</LinearLayout>
<SeekBar
android:id="#+id/seekBar4"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2" >
<TextView
android:id="#+id/ime5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
</LinearLayout>
<SeekBar
android:id="#+id/seekBar5"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2" >
<TextView
android:id="#+id/ime6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
</LinearLayout>
<SeekBar
android:id="#+id/seekBar6"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1" >
<Button android:id="#+id/btn_ok1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="4"
android:text="Ok"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

activity_main:
================
<?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="wrap_content"
android:orientation="vertical"
android:weightSum="8" >
<LinearLayout
android:id="#+id/radiogrouplayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioGroup
android:id="#+id/radioGroup1"
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:weightSum="2" >
<RadioButton
android:id="#+id/blur"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Blur" />
<ImageView
android:id="#+id/widthImageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:paddingLeft="70dp"
android:src="#drawable/ic_launcher" />
</LinearLayout>
<RadioButton
android:id="#+id/outer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Outer" />
<RadioButton
android:id="#+id/inner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Inner" />
<RadioButton
android:id="#+id/pencil"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pencil" />
<RadioButton
android:id="#+id/emboss"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Emboss" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/bottombar"
android:layout_below="#+id/radiogrouplayout"
android:orientation="horizontal" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="false" >
<LinearLayout
android:id="#+id/linearLayoutSeekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:weightSum="2" >
<TextView
android:id="#+id/ime2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Width text" />
<TextView
android:id="#+id/vrednost2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="10" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="#+id/bottombar"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:weightSum="3" >
<Button
android:id="#+id/btn_ok1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="4"
android:text="Ok" />
</LinearLayout>
</RelativeLayout>

Related

Specific Contents are not visible by using or by without using scrollview

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 >

Some views in layout are outside the screen

Top text "Your profile" is not visible in my layout.
In album orientation pictures are truncated.
I have added "Scroll" element, but it does not work there.
My XML is below:
<?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:background="#color/backNormal"
android:orientation="vertical"
>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/backNormal"
android:orientation="vertical"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/backNormal"
android:orientation="vertical"
android:layout_gravity="center_horizontal|center_vertical"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/backNormal"
android:orientation="horizontal"
android:layout_gravity="center_horizontal|center_vertical"
android:weightSum="6"
>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#color/backNormal"
android:orientation="vertical"
android:layout_weight="4"
android:layout_gravity="center_horizontal|center_vertical"
>
<TextView
android:id="#+id/driverProfileTextTitle"
android:gravity="center"
android:text='Your profile'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_title"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<ImageView
android:id="#+id/driverProfileImageFace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:src="#drawable/driver"
android:adjustViewBounds="true"
/>
<ImageView
android:id="#+id/driverProfileImageCar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:src="#drawable/car"
android:adjustViewBounds="true"
/>
</LinearLayout>
<TextView
android:id="#+id/driverProfileTextName"
android:gravity="center"
android:text='Your name'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<EditText
android:id="#+id/driverProfileEditName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="1"
android:minLines="1"
android:maxLines="1"
android:maxLength="25"
style="#style/edit_style"
android:layout_gravity="left"
android:background="#drawable/edit"
android:inputType="textCapSentences"
android:cursorVisible="true"
/>
<TextView
android:id="#+id/driverProfileTextCar"
android:gravity="center"
android:text='Car model and number'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<EditText
android:id="#+id/driverProfileEditCar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="1"
android:minLines="1"
android:maxLines="1"
android:maxLength="25"
style="#style/edit_style"
android:layout_gravity="left"
android:background="#drawable/edit"
android:inputType="textCapSentences"
android:cursorVisible="true"
/>
<TextView
android:id="#+id/driverProfileTextGenderTitle"
android:gravity="center"
android:text='Gender'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:weightSum="4"
>
<Button
android:id="#+id/driverProfileButtonMale"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text='M'
style="#style/button_style_normal"
/>
<TextView
android:id="#+id/driverProfileTextGender"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2"
android:gravity="center"
android:text='Unknown'
android:background="#color/backDark1"
style="#style/text_style_normal"
/>
<Button
android:id="#+id/driverProfileButtonFemale"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text='F'
style="#style/button_style_normal"
/>
</LinearLayout>
<TextView
android:id="#+id/driverProfileTextYearTitle"
android:gravity="center"
android:text='Year Of Birth'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:weightSum="4"
>
<Button
android:id="#+id/driverProfileButtonYearMinus"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text='-'
style="#style/button_style_normal"
/>
<TextView
android:id="#+id/driverProfileTextYear"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2"
android:gravity="center"
android:text='Unknown'
android:background="#color/backDark1"
style="#style/text_style_normal"
/>
<Button
android:id="#+id/driverProfileButtonYearPlus"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text='+'
style="#style/button_style_normal"
/>
</LinearLayout>
<ProgressBar
android:id="#+id/driverProfileProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
/>
<Button
android:id="#+id/driverProfileButtonReg"
android:text='Registration'
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
style="#style/button_style_normal"
/>
<TextView
android:id="#+id/driverProfileTextResult"
android:gravity="center"
android:text=''
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="#style/text_style_normal"
/>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
Any ideas please?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/backNormal"
android:orientation="vertical"
android:fillViewport="true" >
Rest of the code
Use ScrollView as a parent.
I think this can help you.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="8dp"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#color/backNormal"
android:layout_gravity="center_horizontal|center_vertical"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal|center_vertical"
android:weightSum="6"
>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="4"
android:layout_gravity="center_horizontal|center_vertical"
>
<TextView
android:id="#+id/driverProfileTextTitle"
android:gravity="center"
android:text='Your profile'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_title"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<ImageView
android:id="#+id/driverProfileImageFace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:src="#drawable/driver"
android:adjustViewBounds="true"
/>
<ImageView
android:id="#+id/driverProfileImageCar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:src="#drawable/car"
android:adjustViewBounds="true"
/>
</LinearLayout>
<TextView
android:id="#+id/driverProfileTextName"
android:gravity="center"
android:text='Your name'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<EditText
android:id="#+id/driverProfileEditName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="1"
android:minLines="1"
android:maxLines="1"
android:maxLength="25"
style="#style/edit_style"
android:layout_gravity="left"
android:background="#drawable/edit"
android:inputType="textCapSentences"
android:cursorVisible="true"
/>
<TextView
android:id="#+id/driverProfileTextCar"
android:gravity="center"
android:text='Car model and number'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<EditText
android:id="#+id/driverProfileEditCar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="1"
android:minLines="1"
android:maxLines="1"
android:maxLength="25"
style="#style/edit_style"
android:layout_gravity="left"
android:background="#drawable/edit"
android:inputType="textCapSentences"
android:cursorVisible="true"
/>
<TextView
android:id="#+id/driverProfileTextGenderTitle"
android:gravity="center"
android:text='Gender'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:weightSum="4"
>
<Button
android:id="#+id/driverProfileButtonMale"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text='M'
style="#style/button_style_normal"
/>
<TextView
android:id="#+id/driverProfileTextGender"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2"
android:gravity="center"
android:text='Unknown'
android:background="#color/backDark1"
style="#style/text_style_normal"
/>
<Button
android:id="#+id/driverProfileButtonFemale"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text='F'
style="#style/button_style_normal"
/>
</LinearLayout>
<TextView
android:id="#+id/driverProfileTextYearTitle"
android:gravity="center"
android:text='Year Of Birth'
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="#style/text_style_normal"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:weightSum="4"
>
<Button
android:id="#+id/driverProfileButtonYearMinus"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text='-'
style="#style/button_style_normal"
/>
<TextView
android:id="#+id/driverProfileTextYear"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2"
android:gravity="center"
android:text='Unknown'
android:background="#color/backDark1"
style="#style/text_style_normal"
/>
<Button
android:id="#+id/driverProfileButtonYearPlus"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text='+'
style="#style/button_style_normal"
/>
</LinearLayout>
<ProgressBar
android:id="#+id/driverProfileProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
/>
<Button
android:id="#+id/driverProfileButtonReg"
android:text='Registration'
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
style="#style/button_style_normal"
/>
<TextView
android:id="#+id/driverProfileTextResult"
android:gravity="center"
android:text=''
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="#style/text_style_normal"
/>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="5dp"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
but you need improve your layout with more RelativeLayout instead of LinearLayout, and also deep layout level will reduce performance
Use android:fillViewport="true" in your ScrollView and it will fill up the screen.
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
Try this
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/backNormal"
android:orientation="vertical" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#color/backNormal"
android:orientation="vertical" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#color/backNormal"
android:orientation="horizontal"
android:weightSum="6" >
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_weight="4"
android:background="#color/backNormal"
android:orientation="vertical" >
<TextView
android:id="#+id/driverProfileTextTitle"
style="#style/text_style_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="Your profile" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/driverProfileImageFace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:src="#drawable/driver" />
<ImageView
android:id="#+id/driverProfileImageCar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:adjustViewBounds="true"
android:src="#drawable/car" />
</LinearLayout>
<TextView
android:id="#+id/driverProfileTextName"
style="#style/text_style_normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="Your name" />
<EditText
android:id="#+id/driverProfileEditName"
style="#style/edit_style"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="#drawable/edit"
android:cursorVisible="true"
android:inputType="textCapSentences"
android:lines="1"
android:maxLength="25"
android:maxLines="1"
android:minLines="1" />
<TextView
android:id="#+id/driverProfileTextCar"
style="#style/text_style_normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="Car model and number" />
<EditText
android:id="#+id/driverProfileEditCar"
style="#style/edit_style"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="#drawable/edit"
android:cursorVisible="true"
android:inputType="textCapSentences"
android:lines="1"
android:maxLength="25"
android:maxLines="1"
android:minLines="1" />
<TextView
android:id="#+id/driverProfileTextGenderTitle"
style="#style/text_style_normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="Gender" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:weightSum="4" >
<Button
android:id="#+id/driverProfileButtonMale"
style="#style/button_style_normal"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="M" />
<TextView
android:id="#+id/driverProfileTextGender"
style="#style/text_style_normal"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2"
android:background="#color/backDark1"
android:gravity="center"
android:text="Unknown" />
<Button
android:id="#+id/driverProfileButtonFemale"
style="#style/button_style_normal"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="F" />
</LinearLayout>
<TextView
android:id="#+id/driverProfileTextYearTitle"
style="#style/text_style_normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="Year Of Birth" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:weightSum="4" >
<Button
android:id="#+id/driverProfileButtonYearMinus"
style="#style/button_style_normal"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="-" />
<TextView
android:id="#+id/driverProfileTextYear"
style="#style/text_style_normal"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2"
android:background="#color/backDark1"
android:gravity="center"
android:text="Unknown" />
<Button
android:id="#+id/driverProfileButtonYearPlus"
style="#style/button_style_normal"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="+" />
</LinearLayout>
<ProgressBar
android:id="#+id/driverProfileProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal" />
<Button
android:id="#+id/driverProfileButtonReg"
style="#style/button_style_normal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="Registration" />
<TextView
android:id="#+id/driverProfileTextResult"
style="#style/text_style_normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</ScrollView>
I don't have enough reputation to comment, but using ScrollView as parent and android:fillViewport="true" should solve your issue. If it is not specify whether you are able Scroll after adding ScrollView as parent.

Vertical line in XML for notification in Android

I have created a custom notification XML file. I would like to draw a vertical line like the horizontal line in the below picture. I have been trying various ways couldn't achieve it. The orientation in xml from horizontal to vertical didn't help me.
Check my screenshot below:I would like to get the vertical line instead of the red line.
Tried the following code:
<LinearLayout
android:id="#+id/horizontalLayout"
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#000000"
android:orientation="vertical" >
</LinearLayout>
Below is my XML:
<?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="#151515"
android:baselineAligned="false"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/iconimagelayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="5dp" >
<ImageView
android:id="#+id/iconimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/icon"
android:src="#drawable/cancel" />
</LinearLayout>
<LinearLayout
android:id="#+id/NameLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".70"
android:orientation="vertical"
android:paddingLeft="10sp" >
<LinearLayout
android:id="#+id/topTextlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E"
android:gravity="center_horizontal"
android:paddingBottom="5dp" >
<TextView
android:id="#+id/topText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:text="TITLE"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout"
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1C1C1C"
android:paddingTop="5dp" >
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:text="MESSAGE BODY"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout2"
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/alldismisslayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E" >
<ImageView
android:id="#+id/dismissicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/dismissicon"
android:src="#drawable/cancel" />
<LinearLayout
android:id="#+id/dismissLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|left" >
<TextView
android:id="#+id/dismissText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="#string/notificationdismiss"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Not sure where exactly I have to put the vertical line code.
You can use following to create the vertical line.
<View
android:layout_width="4dip"
android:layout_height="match_parent"
android:background="#FF000000"/>
Put this code after your first cancel imageview.So that your final code becomes
<LinearLayout
android:id="#+id/iconimagelayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="5dp" >
<ImageView
android:id="#+id/iconimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/icon"
android:src="#drawable/cancel" />
</LinearLayout>
<View
android:layout_width="4dip"
android:layout_height="match_parent"
android:background="#FF000000"/>
<LinearLayout
android:id="#+id/NameLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".70"
android:orientation="vertical"
android:paddingLeft="10sp" >
<LinearLayout
android:id="#+id/topTextlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E"
android:gravity="center_horizontal"
android:paddingBottom="5dp" >
<TextView
android:id="#+id/topText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:text="TITLE"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout"
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1C1C1C"
android:paddingTop="5dp" >
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:text="MESSAGE BODY"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout2"
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/alldismisslayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E" >
<ImageView
android:id="#+id/dismissicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/dismissicon"
android:src="#drawable/cancel" />
<LinearLayout
android:id="#+id/dismissLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|left" >
<TextView
android:id="#+id/dismissText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="#string/notificationdismiss"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Hope it helps.
Just use proper backgrounds and margin if you need
Here is the screenshot
XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#151515"
android:baselineAligned="false"
>
<ImageView
android:id="#+id/iconimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/topText"
android:contentDescription="string/icon"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/topText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#2E2E2E"
android:layout_centerHorizontal="true"
android:text="TITLE"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:layout_below="#+id/topText"
android:layout_toRightOf="#+id/iconimage"
android:layout_margin="10dp"
android:background="#1C1C1C"
android:text="MESSAGE BODY"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<ImageView
android:id="#+id/dismissicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/text"
android:layout_toRightOf="#+id/iconimage"
android:contentDescription="string/dismissicon"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/dismissText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_toRightOf="#+id/dismissicon"
android:layout_below="#+id/text"
android:background="#2E2E2E"
android:text="notificationdismiss"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<TextView android:layout_width="2dp"
android:layout_height="wrap_content"
android:background="#ff0000"
android:layout_alignRight="#+id/iconimage"
android:layout_alignBottom="#+id/dismissicon"
android:layout_alignTop="#+id/topText"
/>
</RelativeLayout>
hey try this with less layout hierarchy
<?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:background="#1C1C1C"
android:baselineAligned="false"
android:orientation="horizontal" >
<ImageView
android:id="#+id/iconimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/cancel" />
<View
android:layout_width="3dp"
android:layout_height="fill_parent"
android:layout_marginLeft="3dp"
android:background="#color/GREEN" />
<LinearLayout
android:id="#+id/NameLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/topTextlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E"
android:gravity="center_horizontal"
android:paddingBottom="5dp" >
<TextView
android:id="#+id/topText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="5dp"
android:text="TITLE"
android:textColor="#color/WHITE"
android:textSize="18sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="#color/your_color" />
<LinearLayout
android:id="#+id/textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1C1C1C"
android:paddingTop="5dp" >
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:text="MESSAGE BODY"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="#color/GREEN" />
<LinearLayout
android:id="#+id/alldismisslayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E" >
<TextView
android:id="#+id/dismissText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/cancel"
android:drawablePadding="5dp"
android:paddingLeft="5dp"
android:text="#string/notificationdismiss"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
Try this way,hope this will help you to solve your problem.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#151515"
android:baselineAligned="false"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/iconimagelayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp" >
<ImageView
android:id="#+id/iconimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/icon"
android:src="#drawable/ic_launcher" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#FF0000"/>
<LinearLayout
android:id="#+id/NameLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp">
<LinearLayout
android:id="#+id/topTextlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E"
android:gravity="center_horizontal"
android:padding="10dp">
<TextView
android:id="#+id/topText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TITLE"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1C1C1C"
android:padding="10dp">
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MESSAGE BODY"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout2"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/alldismisslayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E"
android:gravity="center">
<ImageView
android:id="#+id/dismissicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/dismissicon"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:id="#+id/dismissLayout"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp">
<TextView
android:id="#+id/dismissText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/notificationdismiss"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Try This:
Create one colored vertical line 9 patch image
then use that image in View in android xml file
Change your XML file like:
<?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="#151515"
android:baselineAligned="false"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/iconimagelayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:layout_marginRight="10dp"
android:paddingLeft="5dp" >
<ImageView
android:id="#+id/iconimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="icon"
android:src="#drawable/ic_launcher" />
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#drawable/untitled" />
</LinearLayout>
<LinearLayout
android:id="#+id/NameLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".70"
android:orientation="vertical"
android:paddingLeft="10sp" >
<LinearLayout
android:id="#+id/topTextlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E"
android:gravity="center_horizontal"
android:paddingBottom="5dp" >
<TextView
android:id="#+id/topText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:text="TITLE"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout"
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1C1C1C"
android:paddingTop="5dp" >
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:text="MESSAGE BODY"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/horizontalLayout2"
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#000000"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/alldismisslayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2E2E2E" >
<ImageView
android:id="#+id/dismissicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="dismissicon"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:id="#+id/dismissLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|left" >
<TextView
android:id="#+id/dismissText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="notificationdismiss"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Here in:
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#drawable/untitled" />
untitled is my 9 patch image.
9 patch image because it could be stretched as per the screen resolution

how to align the button at bottom in linear layout?

I want to keep the adview layout at bottom in linear layout. i tried using gravity and layout_gravity at bottom but its not working,i had attached the code and snapshot too.
please give me any solution
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="#+id/linearmainlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/inner_screen_bg"
android:orientation="vertical"
android:weightSum="10" >
<LinearLayout
android:id="#+id/linear1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal"
android:paddingBottom="10dip"
android:paddingTop="5dip"
android:weightSum="100" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/fbShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/fb_btn"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/twitterShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/tw_btn"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/revealButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/reveal_btn"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
android:id="#+id/imageContainer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginRight="10dip"
android:layout_marginTop="3dp"
android:layout_weight="60"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/imageView"
android:layout_width="320dip"
android:layout_height="150dip"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/image5" >
<ImageView
android:id="#+id/correctMark"
android:layout_width="80dip"
android:layout_height="80dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dip"
android:layout_marginLeft="5dip"
android:src="#drawable/cleared_imag"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/ticketCounterContainer"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/ticket1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ticket"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ticket"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/ticket"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<EditText
android:id="#+id/movieName"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="#id/linear1"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:background="#drawable/input_field"
android:imeOptions="actionDone"
android:inputType="text"
android:padding="10dip" />
<RelativeLayout
android:id="#+id/correctAnswerLayoutContainer"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_below="#id/movieName"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:background="#drawable/circular_rectangle_white_background"
android:paddingLeft="10dip"
android:visibility="gone" >
<LinearLayout
android:id="#+id/hintContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/icon" />
<TextView
android:id="#+id/hintOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/musical_moview_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/icon" />
<TextView
android:id="#+id/hintTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/release_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/icon" />
<TextView
android:id="#+id/hintThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/hint3_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<Button
android:id="#+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dip"
android:layout_weight="1"
android:background="#drawable/next_btn" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="1" >
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="#string/publisher_id"
ads:loadAdOnCreate="true" />
</LinearLayout>
</LinearLayout>
Try this..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="#+id/linearmainlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="10" >
<LinearLayout
android:id="#+id/linear1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal"
android:paddingBottom="10dip"
android:paddingTop="5dip"
android:weightSum="100" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/fbShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/twitterShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/revealButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<RelativeLayout
android:id="#+id/imageContainer"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginRight="10dip"
android:layout_marginTop="3dp"
android:layout_weight="60"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/imageView"
android:layout_width="320dip"
android:layout_height="150dip"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<ImageView
android:id="#+id/correctMark"
android:layout_width="80dip"
android:layout_height="80dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dip"
android:layout_marginLeft="5dip"
android:src="#drawable/ic_launcher"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/ticketCounterContainer"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="20"
android:gravity="center_vertical"
android:orientation="vertical" >
<Button
android:id="#+id/ticket1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="#+id/ticket3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<EditText
android:id="#+id/movieName"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="#+id/linear1"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:imeOptions="actionDone"
android:inputType="text"
android:padding="10dip" />
<RelativeLayout
android:id="#+id/correctAnswerLayoutContainer"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_below="#+id/movieName"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_weight="1"
android:paddingLeft="10dip"
android:visibility="gone" >
<LinearLayout
android:id="#+id/hintContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/hintOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="musical_moview_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/hintTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="release_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="35dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/hintThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="hint3_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:textSize="15dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<Button
android:id="#+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dip"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:orientation="vertical" >
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="#string/publisher_id"
ads:loadAdOnCreate="true" />
</LinearLayout>
</LinearLayout>
Put the button and Adview in a new relative layout below the linear layouts.

How to create a form that have autolookup in Android

I want to use auto look up for searching .
I have partially created this layout . This is my XML code.
Now how can i use autol lookup in this?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="#drawable/logo_demo" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView1"
android:layout_marginTop="10dp"
android:background="#drawable/flight_bar"
android:orientation="horizontal" >
<TextView
android:id="#+id/roundtripTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_marginTop="5dp"
android:layout_weight="0.01"
android:text="Round trip"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/OneWayTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_marginTop="5dp"
android:layout_weight="0.01"
android:text="OneWay"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/multicityTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_marginTop="5dp"
android:layout_weight="0.03"
android:text="MultiCity"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:id="#+id/linearLayout4"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout1"
android:background="#drawable/from2"
android:orientation="horizontal" >
<TextView
android:id="#+id/fromTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="7dp"
android:layout_weight=".05"
android:text="From" />
<TextView
android:id="#+id/toTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="7dp"
android:layout_weight=".05"
android:text="To" />
</LinearLayout>
</RelativeLayout>
i have to use a auto look up box same below to the to i have to use autolook up and in the middle of both there will be image .So i have done till from and to part now i am not able to create to separate auto look up box below from and to.
Try this layout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/imageView1"
android:layout_marginTop="10dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/roundtripTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#FF0000FF"
android:gravity="center"
android:text="Round trip"
android:textColor="#android:color/white"
android:textSize="20sp" />
<TextView
android:id="#+id/OneWayTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#FF0000FF"
android:gravity="center"
android:text="OneWay"
android:textColor="#android:color/white"
android:textSize="20sp" />
<TextView
android:id="#+id/multicityTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#FF0000FF"
android:gravity="center"
android:text="MultiCity"
android:textColor="#android:color/white"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout1"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical" >
<EditText
android:id="#+id/fromTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:gravity="center_horizontal"
android:hint="From" />
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="LON"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="London Great Britain"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#android:color/darker_gray"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical" >
<EditText
android:id="#+id/toTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:gravity="center_horizontal"
android:hint="To" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="DXB"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Dubai United Arab Emirates"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Edit
Put below layout after "from/to" layout.
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/linear3"
android:orientation="horizontal" >
<AutoCompleteTextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="bottom"
android:text="LON" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/darker_gray"
android:src="#drawable/ic_launcher" />
<AutoCompleteTextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="bottom"
android:text="DXB" />
</LinearLayout>

Categories

Resources