I've a feeling I am doing this totally incorrect but I know stack overflow loves an attempt. I am trying to make my whole view scrollable and the icons in my grid view will scroll with my whole view, right now just the icons scroll. I am unsure where to even start with this. I will attach my layout file onto this. I want it to look like below but be a full scrollable view right now only the icons at the bottom scroll.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.curtisboylan.myapplication.SearchScreen"
android:background="#color/grey2">
<ImageView
android:id="#+id/imageView9"
android:layout_below="#+id/editText"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_width="400dp"
android:layout_marginTop="185dp"
android:background="#android:color/white"
android:layout_height="60dp" />
<ImageView
android:id="#+id/imageView7"
android:layout_below="#+id/editText"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_width="400dp"
android:layout_marginTop="115dp"
android:background="#android:color/white"
android:layout_height="60dp" />
<ImageView
android:id="#+id/imageView5"
android:layout_below="#+id/editText"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_width="400dp"
android:background="#android:color/white"
android:layout_marginTop="15dp"
android:layout_height="90dp" />
<!-- DataPicker Text Label and button -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Time Displayed Here"
android:textAlignment="center"
android:id="#+id/txt_TextDateTime"
android:textSize="30dp"
android:layout_alignTop="#+id/imageView5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="17dp" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Click To Change Date"
android:id="#+id/btn_datePicker"
android:background="#null"
android:textAllCaps="false"
android:layout_alignBottom="#+id/imageView5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:layout_width="match_parent"
android:id="#+id/button"
android:layout_x="-10dp"
android:layout_y="481dp"
android:background="#drawable/topbar"
android:layout_height="60dp"
android:text="Continue"
android:textAllCaps="false"
android:textSize="30sp"
android:textColor="#android:color/white"
android:fontFamily="sans-serif"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<GridView
android:id="#+id/gridView1"
android:layout_width="match_parent"
android:numColumns="auto_fit"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
android:layout_height="190dp"
android:layout_below="#+id/imageView9"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="16dp">
</GridView>
<TextView
android:text="What is your location?"
android:layout_x="200dp"
android:layout_y="366dp"
android:id="#+id/textView"
android:textSize="18sp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/button3"
android:layout_alignBottom="#+id/button3"
android:layout_marginLeft="48dp"
android:layout_width="275dp" />
<ImageView
android:layout_height="40dp"
app:srcCompat="#drawable/devices"
android:id="#+id/imageView8"
android:layout_width="30dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="125dp" />
<ImageView
android:layout_height="40dp"
app:srcCompat="#drawable/locicon1"
android:id="#+id/imageView6"
android:layout_width="22dp"
android:layout_marginTop="10dp"
android:layout_alignTop="#+id/imageView9"
android:layout_alignLeft="#+id/imageView8"
android:layout_alignStart="#+id/imageView8"
android:layout_marginLeft="5dp" />
<Button
android:id="#+id/button3"
android:background="#drawable/locationicon2"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignBottom="#+id/imageView6"
android:layout_toRightOf="#+id/textView"
android:layout_toEndOf="#+id/textView"
android:layout_marginBottom="9dp" />
<Button
android:text=""
android:background="#android:color/transparent"
android:textSize="18sp"
android:textAllCaps="false"
android:layout_width="280dp"
android:layout_height="60dp"
android:id="#+id/googleLocBtn"
android:layout_alignBaseline="#+id/textView"
android:layout_alignBottom="#+id/textView"
android:layout_toStartOf="#+id/button3" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/editText2"
android:hint="What is the device you wish to fix?"
android:background="#android:color/transparent"
android:layout_marginBottom="8dp"
android:layout_alignBottom="#+id/imageView8"
android:layout_toRightOf="#+id/imageView8"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_alignRight="#+id/button3"
android:layout_alignEnd="#+id/button3" />
<!-- End -->
</RelativeLayout>
</ScrollView>
Use android.support.v4.widget.NestedScrollView instead of ScrollView.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:background="#color/grey2">
<ImageView
android:id="#+id/imageView9"
android:layout_below="#+id/editText"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_width="400dp"
android:layout_marginTop="185dp"
android:background="#android:color/white"
android:layout_height="60dp" />
<ImageView
android:id="#+id/imageView7"
android:layout_below="#+id/editText"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_width="400dp"
android:layout_marginTop="115dp"
android:background="#android:color/white"
android:layout_height="60dp" />
<ImageView
android:id="#+id/imageView5"
android:layout_below="#+id/editText"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_width="400dp"
android:background="#android:color/white"
android:layout_marginTop="15dp"
android:layout_height="90dp" />
<!-- DataPicker Text Label and button -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Time Displayed Here"
android:textAlignment="center"
android:id="#+id/txt_TextDateTime"
android:textSize="30dp"
android:layout_alignTop="#+id/imageView5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="17dp" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Click To Change Date"
android:id="#+id/btn_datePicker"
android:background="#null"
android:textAllCaps="false"
android:layout_alignBottom="#+id/imageView5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:layout_width="match_parent"
android:id="#+id/button"
android:layout_x="-10dp"
android:layout_y="481dp"
android:background="#drawable/topbar"
android:layout_height="60dp"
android:text="Continue"
android:textAllCaps="false"
android:textSize="30sp"
android:textColor="#android:color/white"
android:fontFamily="sans-serif"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<GridView
android:id="#+id/gridView1"
android:layout_width="match_parent"
android:numColumns="auto_fit"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
android:layout_height="190dp"
android:layout_below="#+id/imageView9"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="16dp">
</GridView>
<TextView
android:text="What is your location?"
android:layout_x="200dp"
android:layout_y="366dp"
android:id="#+id/textView"
android:textSize="18sp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/button3"
android:layout_alignBottom="#+id/button3"
android:layout_marginLeft="48dp"
android:layout_width="275dp" />
<ImageView
android:layout_height="40dp"
app:srcCompat="#drawable/devices"
android:id="#+id/imageView8"
android:layout_width="30dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="125dp" />
<ImageView
android:layout_height="40dp"
app:srcCompat="#drawable/locicon1"
android:id="#+id/imageView6"
android:layout_width="22dp"
android:layout_marginTop="10dp"
android:layout_alignTop="#+id/imageView9"
android:layout_alignLeft="#+id/imageView8"
android:layout_alignStart="#+id/imageView8"
android:layout_marginLeft="5dp" />
<Button
android:id="#+id/button3"
android:background="#drawable/locationicon2"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignBottom="#+id/imageView6"
android:layout_toRightOf="#+id/textView"
android:layout_toEndOf="#+id/textView"
android:layout_marginBottom="9dp" />
<Button
android:text=""
android:background="#android:color/transparent"
android:textSize="18sp"
android:textAllCaps="false"
android:layout_width="280dp"
android:layout_height="60dp"
android:id="#+id/googleLocBtn"
android:layout_alignBaseline="#+id/textView"
android:layout_alignBottom="#+id/textView"
android:layout_toStartOf="#+id/button3" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/editText2"
android:hint="What is the device you wish to fix?"
android:background="#android:color/transparent"
android:layout_marginBottom="8dp"
android:layout_alignBottom="#+id/imageView8"
android:layout_toRightOf="#+id/imageView8"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_alignRight="#+id/button3"
android:layout_alignEnd="#+id/button3" />
<!-- End -->
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
Related
i have a linear layout which is linked to an activity and i want to draw a line over it from a view class using addview but the problem is that when i add using addview then it shift the whole screen upwards. I want to draw a line at specific position without changing the layout. if this can we done by any other method that will be ok. Please help. Also tell that how to remove a Addview.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:weightSum="7"
android:background="#mipmap/untitled_3"
android:id="#+id/multiplayer_game_activity"
tools:context="com.bussiness.vidit.ticktacknoughtsandcrosses.Multiplayer_game">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_weight="1.18"
android:weightSum="3">
<TextView
android:id="#+id/reset_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/name_tv"
android:layout_alignBottom="#+id/name_tv"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:onClick="reset"
android:text="RESET"
android:textColor="#android:color/holo_blue_bright"
android:textSize="10sp" />
<TextView
android:id="#+id/name_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
android:textColor="#android:color/white"
android:textSize="18sp"
android:layout_alignBaseline="#+id/turn_tv"
android:layout_alignBottom="#+id/turn_tv"
android:layout_toRightOf="#+id/turn_tv"
android:layout_toEndOf="#+id/turn_tv" />
<TextView
android:id="#+id/turn_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="9dp"
android:layout_marginStart="9dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:text="TURN - "
android:textColor="#android:color/holo_purple"
android:textSize="15sp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:weightSum="3"
android:layout_weight="0.87">
<ImageView
android:id="#+id/iv1"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="#+id/iv2"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="#+id/iv3"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:weightSum="3"
android:layout_weight="0.68">
<ImageView
android:id="#+id/iv4"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="#+id/iv5"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="#+id/iv6"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:weightSum="3"
android:layout_weight="0.80">
<ImageView
android:id="#+id/iv7"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="#+id/iv8"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="#+id/iv9"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_weight="4">
<com.google.android.gms.ads.AdView
android:id="#+id/adView_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="#string/banner_home_footer"
android:layout_marginBottom="30dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"></com.google.android.gms.ads.AdView>
<ImageView
android:id="#+id/imageView4"
android:layout_width="75dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:src="#drawable/cross" />
<TextView
android:id="#+id/cross_win_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/imageView4"
android:layout_alignStart="#+id/imageView4"
android:layout_below="#+id/imageView4"
android:layout_marginLeft="29dp"
android:layout_marginStart="29dp"
android:text="0"
android:textColor="#android:color/holo_green_light"
android:textSize="25dp" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="75dp"
android:layout_height="50dp"
android:layout_above="#+id/cross_win_tv"
android:layout_centerHorizontal="true"
android:layout_weight="1"
android:src="#drawable/circle" />
<TextView
android:id="#+id/cirle_win_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView5"
android:layout_centerHorizontal="true"
android:text="0"
android:textColor="#android:color/holo_red_light"
android:textSize="25dp" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/imageView4"
android:layout_marginEnd="11dp"
android:layout_marginRight="11dp"
android:text="Draws"
android:textColor="#android:color/holo_orange_light"
android:textSize="25dp" />
<TextView
android:id="#+id/draw_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView4"
android:layout_alignStart="#+id/textView4"
android:layout_below="#+id/imageView5"
android:layout_marginLeft="27dp"
android:layout_marginStart="27dp"
android:text="0"
android:textColor="#android:color/holo_orange_light"
android:textSize="25dp" />
</RelativeLayout>
I couldn't get exactly what you want. I assume that you want to draw a "1 px line". If so, you can do it like this:
<View
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="1dp" />
i have this layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:background="#color/black_30">
<android.support.v7.widget.Toolbar
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:id="#+id/toolbarAnnouncement"
android:theme="#style/ToolBarStyle"
android:elevation="5dp"
android:textAlignment="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_gravity="center"
android:id="#+id/toolbar_title"
android:textSize="20sp"
android:textStyle="bold"
android:background="#00000000"
android:textColor="#ffffff" />
</android.support.v7.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="15"
android:id="#+id/channelContainer"
android:orientation="horizontal"
android:layout_below="#+id/toolbarAnnouncement"
android:background="#color/black_30">
<TextView
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="To :"
android:id="#+id/textView16"
android:textSize="20sp"
android:paddingLeft="5dp"
android:layout_gravity="center_vertical" />
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="11"
android:id="#+id/chipViewLayout"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<com.plumillonforge.android.chipview.ChipView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/buttonChannelSelectorAnnouncement"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:gravity="left"
android:padding="5dp"
android:minHeight="90dp" />
</RelativeLayout>
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="wrap_content"
android:id="#+id/buttonRemoveChannel"
android:background="#android:drawable/ic_menu_close_clear_cancel"
android:visibility="gone"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/attacheImage1"
android:layout_below="#+id/channelContainer"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#ffffff"
android:visibility="gone">
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:id="#+id/imageViewAttach1"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:background="#ffffff"
android:src="#drawable/location" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Attached."
android:id="#+id/textViewAttach1"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageViewAttach1"
android:layout_toEndOf="#+id/imageViewAttach1"
android:layout_marginLeft="10dp"
android:layout_marginBottom="5dp" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Remove"
android:id="#+id/buttonAttach1"
android:layout_alignParentTop="false"
android:layout_alignParentRight="true" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progressBarAttach1"
android:layout_above="#+id/textViewAttach1"
android:layout_alignLeft="#+id/textViewAttach1"
android:layout_toLeftOf="#+id/buttonAttach1"
android:layout_toStartOf="#+id/buttonAttach1"
android:layout_marginRight="5dp"
android:indeterminate="false"
android:progress="100" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/attacheImage2"
android:layout_below="#+id/attacheImage1"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:background="#ffffff"
android:visibility="gone">
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:id="#+id/imageViewAttach2"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:background="#ffffff"
android:src="#android:drawable/sym_def_app_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Attaching..."
android:id="#+id/textViewAtttach2"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageViewAttach2"
android:layout_toEndOf="#+id/imageViewAttach2"
android:layout_marginLeft="10dp"
android:layout_marginBottom="5dp" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:id="#+id/buttonAttach2"
android:layout_alignParentTop="false"
android:layout_alignParentRight="true" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progressBarAttach2"
android:layout_above="#+id/textViewAtttach2"
android:layout_alignLeft="#+id/textViewAtttach2"
android:layout_toLeftOf="#+id/buttonAttach2"
android:layout_toStartOf="#+id/buttonAttach2"
android:layout_marginRight="5dp"
android:indeterminate="false"
android:progress="77" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/attacheImage3"
android:layout_below="#+id/attacheImage2"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#ffffff"
android:visibility="gone">
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:id="#+id/imageViewAttach3"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:background="#ffffff"
android:src="#drawable/icon_admin" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Attaching..."
android:id="#+id/textViewAttach3"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageViewAttach3"
android:layout_toEndOf="#+id/imageViewAttach3"
android:layout_marginLeft="10dp"
android:layout_marginBottom="5dp" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:id="#+id/buttonAttach3"
android:layout_alignParentTop="false"
android:layout_alignParentRight="true" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progressBarAttach3"
android:layout_above="#+id/textViewAttach3"
android:layout_alignLeft="#+id/textViewAttach3"
android:layout_toLeftOf="#+id/buttonAttach3"
android:layout_toStartOf="#+id/buttonAttach3"
android:layout_marginRight="5dp"
android:indeterminate="false"
android:progress="43" />
</RelativeLayout>
<EditText
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:inputType="textMultiLine"
android:ems="10"
android:fitsSystemWindows="true"
android:id="#+id/editText"
android:hint="write from here..."
android:gravity="top"
android:padding="5dp"
android:layout_above="#+id/relativeLayout4"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_below="#+id/attacheImage3"
android:background="#ffffff" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#color/button_material_light"
android:id="#+id/relativeLayout4">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="Image"
android:id="#+id/buttonAddImage"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="Send"
android:id="#+id/button2"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
and in my layout when i start editing my editText every other layout moves up with keyboard but not the layout that is on bottom(with 2 buttons), i want it to move up too , so that it can be visible while editing my editText
any idea how i can i do this ?? my manifest for my activity :
<activity android:name=".myActivity"
android:theme="#style/AppTheme.NoActionBar"/>
what i actually need looks like this :
SEE THAT THING ON THE BOTTOM IN IOS WE CALL IT INPUT ACCESSORY
and when editing starts :
THAT LAYOUT MOVES UP WITH KEYBOARD
and what i have is this :
and when editing starts :
Try to use that new XML Layout File:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:background="#color/black_30">
<android.support.v7.widget.Toolbar
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:id="#+id/toolbarAnnouncement"
android:elevation="5dp"
android:theme="#style/ToolBarStyle"
android:textAlignment="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_gravity="center"
android:id="#+id/toolbar_title"
android:textSize="20sp"
android:textStyle="bold"
android:background="#00000000"
android:textColor="#ffffff" />
</android.support.v7.widget.Toolbar>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:weightSum="15"
android:id="#+id/channelContainer"
android:orientation="horizontal"
android:layout_below="#+id/toolbarAnnouncement"
android:background="#color/black_30"
android:layout_weight="0.20">
<TextView
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="To :"
android:id="#+id/textView16"
android:textSize="20sp"
android:paddingLeft="5dp"
android:layout_gravity="center_vertical" />
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="11"
android:id="#+id/chipViewLayout"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<com.plumillonforge.android.chipview.ChipView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/buttonChannelSelectorAnnouncement"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:gravity="left"
android:padding="5dp"
android:minHeight="90dp" />
</RelativeLayout>
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="wrap_content"
android:id="#+id/buttonRemoveChannel"
android:background="#android:drawable/ic_menu_close_clear_cancel"
android:visibility="gone"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/attacheImage1"
android:layout_below="#+id/channelContainer"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#ffffff"
android:visibility="gone">
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:id="#+id/imageViewAttach1"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:background="#ffffff"
android:src="#drawable/location" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Attached."
android:id="#+id/textViewAttach1"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageViewAttach1"
android:layout_toEndOf="#+id/imageViewAttach1"
android:layout_marginLeft="10dp"
android:layout_marginBottom="5dp" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Remove"
android:id="#+id/buttonAttach1"
android:layout_alignParentTop="false"
android:layout_alignParentRight="true" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progressBarAttach1"
android:layout_above="#+id/textViewAttach1"
android:layout_alignLeft="#+id/textViewAttach1"
android:layout_toLeftOf="#+id/buttonAttach1"
android:layout_toStartOf="#+id/buttonAttach1"
android:layout_marginRight="5dp"
android:indeterminate="false"
android:progress="100" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/attacheImage2"
android:layout_below="#+id/attacheImage1"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:background="#ffffff"
android:visibility="gone">
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:id="#+id/imageViewAttach2"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:background="#ffffff"
android:src="#android:drawable/sym_def_app_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Attaching..."
android:id="#+id/textViewAtttach2"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageViewAttach2"
android:layout_toEndOf="#+id/imageViewAttach2"
android:layout_marginLeft="10dp"
android:layout_marginBottom="5dp" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:id="#+id/buttonAttach2"
android:layout_alignParentTop="false"
android:layout_alignParentRight="true" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progressBarAttach2"
android:layout_above="#+id/textViewAtttach2"
android:layout_alignLeft="#+id/textViewAtttach2"
android:layout_toLeftOf="#+id/buttonAttach2"
android:layout_toStartOf="#+id/buttonAttach2"
android:layout_marginRight="5dp"
android:indeterminate="false"
android:progress="77" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/attacheImage3"
android:layout_below="#+id/attacheImage2"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#ffffff"
android:visibility="gone">
<ImageView
android:layout_width="45dp"
android:layout_height="45dp"
android:id="#+id/imageViewAttach3"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:background="#ffffff"
android:src="#drawable/icon_admin" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Attaching..."
android:id="#+id/textViewAttach3"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageViewAttach3"
android:layout_toEndOf="#+id/imageViewAttach3"
android:layout_marginLeft="10dp"
android:layout_marginBottom="5dp" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:id="#+id/buttonAttach3"
android:layout_alignParentTop="false"
android:layout_alignParentRight="true" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progressBarAttach3"
android:layout_above="#+id/textViewAttach3"
android:layout_alignLeft="#+id/textViewAttach3"
android:layout_toLeftOf="#+id/buttonAttach3"
android:layout_toStartOf="#+id/buttonAttach3"
android:layout_marginRight="5dp"
android:indeterminate="false"
android:progress="43" />
</RelativeLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.70">
<EditText
android:layout_width="match_parent"
android:layout_height="0dp"
android:inputType="textMultiLine"
android:fitsSystemWindows="true"
android:id="#+id/editText"
android:hint="write from here..."
android:gravity="top"
android:padding="5dp"
android:background="#ffffff"
android:ems="10"
android:layout_weight="0.80"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#color/button_material_light"
android:id="#+id/relativeLayout4">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="Image"
android:id="#+id/buttonAddImage"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="Send"
android:id="#+id/button2"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
This is because of you set android:layout_alignParentBottom="true" to relativeLayout4 this won't allow it to scroll upwards. Set Top margin according to your needs or Take Linearlayout and adjust layout by weightsum property and layout_weight property.
In my app i am using recyclerview.I want customize list data so i have made a custom adapter.Now the problem is that the view appears to be of full width in the preview window of android studio but on the device its not full width so my half data is getting cutted.
XMl
<?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:layout_marginBottom="2dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="2dp"
android:background="#EDEFF1">
<TextView
android:id="#+id/tv_g_name"
style="#style/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:padding="10dp"
android:text="Ashton Kutcher" />
<ImageView
android:id="#+id/iv_g_del"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:padding="10dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/textView33"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/tv_g_name"
android:layout_toLeftOf="#+id/iv_g_del"
android:layout_toStartOf="#+id/iv_g_del"
android:background="#D6D7D9" />
<ImageView
android:id="#+id/iv_g_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/textView33"
android:layout_toStartOf="#+id/textView33"
android:padding="10dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/textView34"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/textView33"
android:layout_toLeftOf="#+id/iv_g_add"
android:layout_toStartOf="#+id/iv_g_add"
android:background="#D6D7D9" />
<TextView
android:id="#+id/textView35"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/iv_g_add"
android:background="#D6D7D9" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignTop="#+id/textView35"
android:paddingBottom="05dp"
android:paddingLeft="10dp"
android:paddingRight="05dp"
android:paddingTop="05dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/tv_g_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView5"
android:layout_below="#+id/textView35"
android:layout_toEndOf="#+id/imageView5"
android:layout_toRightOf="#+id/imageView5"
android:gravity="center"
android:text="pavanh.dev#gmail.com" />
<ImageView
android:id="#+id/imageView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/tv_g_email"
android:layout_toEndOf="#+id/tv_g_email"
android:layout_toRightOf="#+id/tv_g_email"
android:paddingBottom="05dp"
android:paddingLeft="10dp"
android:paddingRight="05dp"
android:paddingTop="05dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/tv_g_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView6"
android:layout_below="#+id/textView35"
android:layout_toEndOf="#+id/imageView6"
android:layout_toRightOf="#+id/imageView6"
android:gravity="center"
android:text="889845412" />
</RelativeLayout>
Please let me know where i went wrong?
Use Padding in Parent instead of margin like below and also check padding and margin of your ListView which may stop View Rendering Full width
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_paddingLeft="5dp"
android:layout_paddingRight="5dp"
android:layout_marginTop="2dp"
android:background="#EDEFF1">
<TextView
android:id="#+id/tv_g_name"
style="#style/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:padding="10dp"
android:text="Ashton Kutcher" />
<ImageView
android:id="#+id/iv_g_del"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:padding="10dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/textView33"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/tv_g_name"
android:layout_toLeftOf="#+id/iv_g_del"
android:layout_toStartOf="#+id/iv_g_del"
android:background="#D6D7D9" />
<ImageView
android:id="#+id/iv_g_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/textView33"
android:layout_toStartOf="#+id/textView33"
android:padding="10dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/textView34"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/textView33"
android:layout_toLeftOf="#+id/iv_g_add"
android:layout_toStartOf="#+id/iv_g_add"
android:background="#D6D7D9" />
<TextView
android:id="#+id/textView35"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/iv_g_add"
android:background="#D6D7D9" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignTop="#+id/textView35"
android:paddingBottom="05dp"
android:paddingLeft="10dp"
android:paddingRight="05dp"
android:paddingTop="05dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/tv_g_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView5"
android:layout_below="#+id/textView35"
android:layout_toEndOf="#+id/imageView5"
android:layout_toRightOf="#+id/imageView5"
android:gravity="center"
android:text="pavanh.dev#gmail.com" />
<ImageView
android:id="#+id/imageView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/tv_g_email"
android:layout_toEndOf="#+id/tv_g_email"
android:layout_toRightOf="#+id/tv_g_email"
android:paddingBottom="05dp"
android:paddingLeft="10dp"
android:paddingRight="05dp"
android:paddingTop="05dp"
android:src="#drawable/ic_cancellation" />
<TextView
android:id="#+id/tv_g_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView6"
android:layout_below="#+id/textView35"
android:layout_toEndOf="#+id/imageView6"
android:layout_toRightOf="#+id/imageView6"
android:gravity="center"
android:text="889845412" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_content"
android:layout_marginBottom="2dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="2dp"
android:background="#EDEFF1">
try this,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="2dp"
android:background="#EDEFF1">
<TextView
android:id="#+id/tv_g_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:padding="10dp"
android:text="Ashton Kutcher" />
<ImageView
android:id="#+id/iv_g_del"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:padding="10dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/textView33"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/tv_g_name"
android:layout_toLeftOf="#+id/iv_g_del"
android:layout_toStartOf="#+id/iv_g_del"
android:background="#D6D7D9" />
<ImageView
android:id="#+id/iv_g_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/textView33"
android:layout_toStartOf="#+id/textView33"
android:padding="10dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/textView34"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/textView33"
android:layout_toLeftOf="#+id/iv_g_add"
android:layout_toStartOf="#+id/iv_g_add"
android:background="#D6D7D9" />
<TextView
android:id="#+id/textView35"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/iv_g_add"
android:background="#D6D7D9" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignTop="#+id/textView35"
android:paddingBottom="05dp"
android:paddingLeft="10dp"
android:paddingRight="05dp"
android:paddingTop="05dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_g_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView5"
android:layout_below="#+id/textView35"
android:layout_toEndOf="#+id/imageView5"
android:layout_toRightOf="#+id/imageView5"
android:gravity="center"
android:text="pavanh.dev#gmail.com" />
<ImageView
android:id="#+id/imageView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/tv_g_email"
android:layout_toEndOf="#+id/tv_g_email"
android:layout_toRightOf="#+id/tv_g_email"
android:paddingBottom="05dp"
android:paddingLeft="10dp"
android:paddingRight="05dp"
android:paddingTop="05dp"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/tv_g_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView6"
android:layout_below="#+id/textView35"
android:layout_toEndOf="#+id/imageView6"
android:layout_toRightOf="#+id/imageView6"
android:gravity="center"
android:text="889845412" />
</RelativeLayout>
Try using fill_parent instead of match_parent
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="2dp"
android:background="#EDEFF1">
And in 1st TextView, you have forgotten mentioning the namespace android:style. Please rectify that.
When you create the recyclerview, you normally have the layout for the individual items in the list and then the layout that contains the actual recyclerview. The layout for the actual recyclerview might have contain some type of padding or margin which is why it doesn't fill up the screen.
You will need to check that layout and not the layout for the individual items in the list.
You have also not posted the layout that contains the recyclerview so we are not able to evaluate.
I have created a layout with edit boxes ,textfields,buttons and images etc. But when i try to type something in my edit box the keyboard appears and my layout changes horribly .how can i fix this?
before keyboard appears
after keyboard appears
my layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="#+id/contactus_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="#string/cinema_contactus"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="20dp" />
<EditText
android:id="#+id/contactus_name_edittext"
android:layout_width="340dp"
android:layout_height="40dp"
android:layout_above="#+id/contactus_email_edittext"
android:layout_alignLeft="#+id/contactus_email_edittext"
android:layout_alignRight="#+id/contactus_email_edittext"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="#drawable/rounded_edittext"
android:ems="10"
android:hint="Name"
android:textSize="12sp" />
<EditText
android:id="#+id/contactus_email_edittext"
android:layout_width="340dp"
android:layout_height="40dp"
android:layout_above="#+id/contactus_message_edittext"
android:layout_marginBottom="20dp"
android:layout_toRightOf="#+id/fax"
android:background="#drawable/rounded_edittext"
android:ems="10"
android:hint="E-mail"
android:textSize="12sp" />
<EditText
android:id="#+id/contactus_message_edittext"
android:layout_width="340dp"
android:layout_height="115dp"
android:layout_above="#+id/contactus_submit_button"
android:layout_alignLeft="#+id/contactus_email_edittext"
android:layout_alignRight="#+id/contactus_email_edittext"
android:layout_marginBottom="20dp"
android:background="#drawable/rounded_edittext"
android:ems="10"
android:gravity="top|left"
android:hint="Message"
android:textSize="12sp" />
<Button
android:id="#+id/contactus_submit_button"
android:layout_width="125dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/mybutton"
android:text="#string/submit"
android:layout_marginBottom="30dp"
android:layout_marginTop="20dp"
android:textSize="14dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
<ImageView
android:id="#+id/emailedit"
android:layout_width="45dp"
android:layout_height="40dp"
android:layout_alignTop="#+id/contactus_email_edittext"
android:layout_toLeftOf="#+id/contactus_email_edittext"
android:src="#drawable/emailtop" />
<ImageView
android:id="#+id/nameedit"
android:layout_width="45dp"
android:layout_height="40dp"
android:layout_alignTop="#+id/contactus_name_edittext"
android:layout_toLeftOf="#+id/contactus_name_edittext"
android:src="#drawable/nametop" />
<ImageView
android:id="#+id/messageedit"
android:layout_width="45dp"
android:layout_height="115dp"
android:layout_alignTop="#+id/contactus_message_edittext"
android:layout_toLeftOf="#+id/contactus_message_edittext"
android:src="#drawable/messagetop" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/contactus_submit_button"
android:layout_below="#+id/contactus_email_edittext"
android:orientation="horizontal" >
</LinearLayout>
<ImageView
android:id="#+id/fax"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignTop="#+id/contactus_telephone2"
android:layout_toLeftOf="#+id/contactus_telephone2"
android:layout_marginTop="3dp"
android:src="#drawable/fax" />
<ImageView
android:id="#+id/email"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignTop="#+id/contactus_email"
android:layout_toLeftOf="#+id/contactus_email"
android:layout_marginTop="3dp"
android:src="#drawable/message" />
<ImageView
android:id="#+id/telephone"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignTop="#+id/contactus_telephone1"
android:layout_toLeftOf="#+id/contactus_telephone1"
android:layout_marginTop="3dp"
android:src="#drawable/call" />
<ImageView
android:id="#+id/addresspointer"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignLeft="#+id/telephone"
android:layout_alignTop="#+id/contactus_address"
android:layout_marginTop="3dp"
android:src="#drawable/pointer" />
<TextView
android:id="#+id/contactus_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/contactus_submit_button"
android:layout_centerHorizontal="true"
android:text="#string/cinema_contactus_address"
android:textColor="#000000"
android:lineSpacingExtra="5dp"
android:textSize="14sp"
android:layout_marginTop="25dp" />
<TextView
android:id="#+id/contactus_telephone1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/contactus_address"
android:layout_below="#+id/contactus_address"
android:text="#string/cinema_contactus_telephone1"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:textSize="14sp" />
<TextView
android:id="#+id/contactus_telephone2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/telephone"
android:layout_toRightOf="#+id/telephone"
android:text="#string/cinema_contactus_telephone2"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:textSize="14sp" />
<TextView
android:id="#+id/contactus_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/contactus_telephone2"
android:layout_below="#+id/contactus_telephone1"
android:text="#string/cinema_contactus_email"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:textSize="14sp" />
</RelativeLayout>
try this
inside onCreate write
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
Ok found the answer
i just had to add the following in my activity in manifest
android:windowSoftInputMode="adjustPan"
i have item listview layout with relative layout , but when i'm set "fill_parent" height, it's seem not fill, how make it ?
this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/layout_full"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:layout_margin="4dp"
android:background="#drawable/inbox_interface" >
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="TextView" />
</LinearLayout>
<ImageView
android:id="#+id/favorite_anim"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:contentDescription="#string/favorite_anime"
android:src="#drawable/favorite_active" />
<RelativeLayout
android:id="#+id/lay_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp" >
<TextView
android:id="#+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="6dp"
android:layout_marginTop="1dp"
android:layout_toLeftOf="#+id/act_item_list"
android:layout_toRightOf="#+id/avatardetail"
android:textColor="#6495ed"
android:textSize="16sp"
android:textStyle="bold"
android:typeface="sans" />
<TextView
android:id="#+id/date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/username"
android:layout_alignRight="#+id/username"
android:layout_below="#+id/username"
android:layout_marginBottom="4dp"
android:textColor="#555555"
android:textSize="12sp"
android:textStyle="italic"
android:typeface="sans" />
<ImageView
android:id="#+id/act_item_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:contentDescription="#string/act_item_list"
android:src="#drawable/act_list" />
<com.droidersuin.project.utils.RoundedImageView
android:id="#+id/avatardetail"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="centerCrop"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/avatar_user" />
</RelativeLayout>
<LinearLayout
android:id="#+id/isi_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/lay_top"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="#+id/judul"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:textColor="#6495ed"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/id_tulisan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/judul"
android:visibility="gone" />
<TextView
android:id="#+id/avatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/id_tulisan"
android:visibility="gone" />
<TextView
android:id="#+id/kordinat_lokasi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/avatar"
android:visibility="gone" />
<TextView
android:id="#+id/judul_seo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/kordinat_lokasi"
android:visibility="gone" />
<TextView
android:id="#+id/status_gambar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/judul_seo"
android:visibility="gone" />
<TextView
android:id="#+id/gambar_tulisan_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/status_gambar"
android:visibility="gone" />
<ImageView
android:id="#+id/gambar_tulisan"
android:layout_width="96dp"
android:layout_height="96dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/judul"
android:layout_gravity="top"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="6dp"
android:background="#drawable/image_bg"
android:contentDescription="#string/gambar_tulisan"
android:cropToPadding="true"
android:scaleType="centerCrop"
android:src="#drawable/detail_droidersuin" />
<TextView
android:id="#+id/sekilas_isi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/gambar_tulisan"
android:layout_alignTop="#+id/gambar_tulisan"
android:layout_below="#+id/judul"
android:layout_toRightOf="#+id/gambar_tulisan"
android:textColor="#555555"
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:id="#+id/CommentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingBottom="4dp" >
<TextView
android:id="#+id/dibaca"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:paddingTop="4dp"
android:textColor="#555555"
android:textSize="12sp"
android:textStyle="italic"
android:typeface="sans" />
<ImageView
android:id="#+id/reader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:contentDescription="#string/reader"
android:src="#drawable/reader" />
<TextView
android:id="#+id/jmlh_komentar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:textColor="#555555"
android:textSize="12sp"
android:textStyle="italic"
android:typeface="sans" />
<ImageView
android:id="#+id/ic_komentar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:contentDescription="#string/ic_komentar"
android:src="#drawable/comment" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/action_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/isi_layout"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:clickable="false" >
<ImageButton
android:id="#+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="#drawable/button_action_indicator"
android:contentDescription="#string/button_favorite"
android:src="#drawable/favorite_noactive" />
<ImageButton
android:id="#+id/share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="8dp"
android:layout_toRightOf="#+id/comment"
android:background="#drawable/button_action_indicator"
android:contentDescription="#string/button_share"
android:src="#drawable/share" />
<ImageButton
android:id="#+id/comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="8dp"
android:layout_toRightOf="#+id/favorite"
android:background="#drawable/button_action_indicator"
android:contentDescription="#string/button_comment"
android:src="#drawable/komentar" />
</RelativeLayout>
</RelativeLayout>
the problem is here , the linearlayout not fill height , but width no problem ,
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:layout_margin="4dp"
android:background="#drawable/inbox_interface" >
if it is run on the phone, even like this
the view just looks line black line
but I want to look like this
sorry for my english
While inside the code (or the adapter), you could try this, get the height of the screen and set the minimumHeight of the linear layout or relative layout to the height that you obtain.
to get the height of the screen follow this