I need to show an image border from network image. To test this in offline I have created a view with dummy image. but view shoing fine in android studio editor but in real device the image border is not showing.
this is my editor view
this is my device view
activity_test.xml
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorViolet">
<ImageView
android:id="#+id/theme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/border_content"
android:layout_alignTop="#+id/border_content"
android:layout_alignRight="#id/border_content"
android:layout_alignBottom="#id/border_content"
android:src="#drawable/ic_image_border"
android:scaleType="fitXY"/>
<FrameLayout
android:id="#+id/border_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp"
android:background="#drawable/view_border_gradient"
android:layout_margin="20dp">
<LinearLayout
android:id="#+id/background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/image"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
android:contentDescription="#string/content_desc"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="#drawable/img_default" />
<ImageView
android:id="#+id/aura"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
android:contentDescription="#string/content_desc"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="#drawable/img_default" />
<ImageView
android:id="#+id/badge"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="30dp"
android:contentDescription="#string/content_desc"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/charms"
app:layout_constraintStart_toStartOf="#+id/image"
app:layout_constraintTop_toBottomOf="#+id/image"
android:src="#drawable/img_default" />
<ImageView
android:id="#+id/charms"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_below="#id/image"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="30dp"
android:contentDescription="#string/content_desc"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/image"
app:layout_constraintStart_toEndOf="#id/badge"
app:layout_constraintTop_toBottomOf="#+id/image"
android:src="#drawable/img_default" />
<TextView
android:id="#+id/badgeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="#string/badge"
android:textColor="#color/colorHint"
android:textSize="9sp"
app:layout_constraintEnd_toEndOf="#id/badge"
app:layout_constraintStart_toStartOf="#id/badge"
app:layout_constraintTop_toBottomOf="#+id/badge"
tools:ignore="SmallSp" />
<TextView
android:id="#+id/charmTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="#string/charms"
android:textColor="#color/colorHint"
android:textSize="9sp"
app:layout_constraintEnd_toEndOf="#id/charms"
app:layout_constraintStart_toStartOf="#id/charms"
app:layout_constraintTop_toBottomOf="#+id/charms"
tools:ignore="SmallSp" />
<ImageView
android:id="#+id/close"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:contentDescription="#string/content_desc"
android:scaleType="fitXY"
android:tint="#color/colorRed"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_cancel" />
<TextView
android:id="#+id/userName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textColor="#color/colorFont"
android:textSize="11sp"
app:layout_constraintEnd_toStartOf="#+id/close"
app:layout_constraintStart_toStartOf="#+id/addFriend"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SmallSp"
android:text="UserName" />
<TextView
android:id="#+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#color/colorFont"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#id/viewProfile"
app:layout_constraintStart_toStartOf="#+id/addFriend"
app:layout_constraintTop_toBottomOf="#id/close"
android:text="User Full Name"
android:layout_marginTop="5dp"/>
<RelativeLayout
android:id="#+id/viewProfile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#drawable/view_round_sky"
app:layout_constraintEnd_toEndOf="#id/addFriend"
app:layout_constraintStart_toStartOf="#+id/addFriend"
app:layout_constraintTop_toBottomOf="#+id/name">
<ImageView
android:id="#+id/imgViewProfile"
android:layout_width="21dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:background="#drawable/view_round_white"
android:contentDescription="#string/content_desc"
android:paddingStart="3dp"
android:paddingEnd="3dp"
app:srcCompat="#drawable/ic_profile_view" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imgViewProfile"
android:paddingStart="5dp"
android:paddingEnd="15dp"
android:text="#string/view_profile"
android:textColor="#color/colorWhite"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/addFriend"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="15dp"
android:background="#drawable/view_round_blue"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#id/image"
app:layout_constraintTop_toBottomOf="#id/viewProfile">
<ImageView
android:id="#+id/imgViewProfileAdd"
android:layout_width="21dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:background="#drawable/view_round_white"
android:contentDescription="#string/content_desc"
android:paddingStart="3dp"
android:paddingEnd="3dp"
app:srcCompat="#drawable/ic_profile_add" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imgViewProfileAdd"
android:paddingStart="5dp"
android:paddingEnd="15dp"
android:text="#string/add_as_friend"
android:textColor="#color/colorWhite"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#drawable/view_round_yellow"
app:layout_constraintEnd_toEndOf="#id/addFriend"
app:layout_constraintStart_toStartOf="#id/addFriend"
app:layout_constraintTop_toBottomOf="#id/addFriend">
<ImageView
android:id="#+id/imgMessage"
android:layout_width="21dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:background="#drawable/view_round_white"
android:contentDescription="#string/content_desc"
android:paddingStart="3dp"
android:paddingEnd="3dp"
app:srcCompat="#drawable/ic_profile_message" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imgMessage"
android:paddingStart="5dp"
android:paddingEnd="15dp"
android:text="#string/messages"
android:textColor="#color/colorWhite"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/gift"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#drawable/view_round_orange"
app:layout_constraintEnd_toEndOf="#id/addFriend"
app:layout_constraintStart_toStartOf="#id/addFriend"
app:layout_constraintTop_toBottomOf="#id/message">
<ImageView
android:id="#+id/imgGift"
android:layout_width="21dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:background="#drawable/view_round_white"
android:contentDescription="#string/content_desc"
android:paddingStart="3dp"
android:paddingEnd="3dp"
app:srcCompat="#drawable/ic_profile_gift" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imgGift"
android:paddingStart="5dp"
android:paddingEnd="15dp"
android:text="#string/gift"
android:textColor="#color/colorWhite"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/block"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
android:background="#drawable/view_round_red"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#id/addFriend"
app:layout_constraintStart_toStartOf="#id/addFriend"
app:layout_constraintTop_toBottomOf="#id/gift">
<ImageView
android:id="#+id/imgBlock"
android:layout_width="21dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:background="#drawable/view_round_white"
android:contentDescription="#string/content_desc"
android:paddingStart="3dp"
android:paddingEnd="3dp"
app:srcCompat="#drawable/ic_profile_black" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/imgBlock"
android:paddingStart="5dp"
android:paddingEnd="15dp"
android:text="#string/block"
android:textColor="#color/colorWhite"
android:textSize="12sp" />
</RelativeLayout>
<androidx.constraintlayout.widget.Group
android:id="#+id/groupButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:constraint_referenced_ids="addFriend,message,gift,block" />
<androidx.constraintlayout.widget.Group
android:id="#+id/badge_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
app:constraint_referenced_ids="badgeTitle,badge"
tools:layout_editor_absoluteX="4dp"
tools:layout_editor_absoluteY="4dp"
tools:visibility="visible" />
<androidx.constraintlayout.widget.Group
android:id="#+id/charms_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
app:constraint_referenced_ids="charms,charmTitle"
tools:layout_editor_absoluteX="4dp"
tools:layout_editor_absoluteY="4dp"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</RelativeLayout>
Test.java
public class Test extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
}
}
this is the Border image file to used in the layout file
Glide cache is causing the problem. It is now fixed after restarting the app
Related
I want the first button aligned to the left as it is and the other button below it to be aligned to the right.
I've tried a lot of stuff but nothing seems to work. Both buttons are in a scroll view.
Below is my XML Activity.
The background the buttons are using is an XML Drawable file with a shape.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
tools:context=".pg2">
<ScrollView
android:layout_width="395dp"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView4"
android:layout_width="243.288590604dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:contentDescription="#string/logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.151"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.035"
app:srcCompat="#drawable/frag11" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:fontFamily="#font/open_sans_semibold"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/basic_rules_of_html"
android:textColor="#000000"
android:textSize="34sp" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str1"
android:textColor="#0A538F"
android:textSize="30sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="#DADADA"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="#string/str3"
android:textColor="#000000"
android:textSize="30sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str2"
android:textColor="#0A538F"
android:textSize="30sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str4"
android:textColor="#0A538F"
android:textSize="30sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="#DADADA"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="#string/str5"
android:textColor="#000000"
android:textSize="30sp" />
<TextView
android:id="#+id/textView8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str6"
android:textColor="#0A538F"
android:textSize="30sp" />
<Button
android:id="#+id/button2"
android:layout_width="135dp"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:background="#drawable/button_fill"
android:fontFamily="#font/open_sans_semibold"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/cont_"
android:textAlignment="textStart"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<Button
android:id="#+id/button"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#drawable/code"
android:text="#string/code"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="42sp"/>
<TextView
android:id="#+id/textView6"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
.
.
.
.
.
.
.
.
.
.
I would appreciate any help anyone can provide, I've tried a lot of stuff and nothing seems to work.
Please check below layout, I've updated your layout. I've just added a Framlayout as a parent of two Button.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorWhite">
<ScrollView
android:layout_width="395dp"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView4"
android:layout_width="243.288590604dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:contentDescription="#string/logo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.151"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.035"
app:srcCompat="#drawable/frag11" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:fontFamily="#font/open_sans_semibold"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/basic_rules_of_html"
android:textColor="#000000"
android:textSize="34sp" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str1"
android:textColor="#0A538F"
android:textSize="30sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="#DADADA"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="#string/str3"
android:textColor="#000000"
android:textSize="30sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str2"
android:textColor="#0A538F"
android:textSize="30sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str4"
android:textColor="#0A538F"
android:textSize="30sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="#DADADA"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="#string/str5"
android:textColor="#000000"
android:textSize="30sp" />
<TextView
android:id="#+id/textView8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/str6"
android:textColor="#0A538F"
android:textSize="30sp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/button2"
android:layout_width="135dp"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:background="#drawable/button_fill"
android:fontFamily="#font/open_sans_semibold"
android:paddingLeft="20dp"
android:layout_gravity="start|center_vertical"
android:paddingRight="20dp"
android:text="#string/cont_"
android:textAlignment="textStart"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<Button
android:id="#+id/button"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:layout_gravity="end"
android:layout_marginBottom="20dp"
android:background="#drawable/code"
android:text="#string/code"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="42sp" />
</FrameLayout>
<TextView
android:id="#+id/textView6"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
Couple of answers here, have you tried:
android:gravity="start";
or if you want it to the right:
android:gravity="end";
failing that try and place each of the buttons in a linear layout and assigning the gravity to the layout instead.
You can use attribute android:layout_gravity="right"
in button
I've been asked to make a view available with a Scrollview to allow for further additions to the buttons available. The problem is that to arrange the buttons in a 3 x 3 row I've used three successive RelativeLayouts as set out in the code below
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="#color/dialogWhite"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/symptomsTxt"/>
<TextView
android:id="#+id/hdrText"
android:layout_width="370dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/todays_side_effects"
android:textAlignment="center"
android:textSize="16sp"
app:layout_constraintTop_toBottomOf="#+id/symptomsTxt"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<ScrollView
android:id="#+id/scrollViewWB"
android:layout_width="fill_parent"
android:layout_height="400dp"
android:visibility="visible"
android:layout_marginTop="5dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/hdrText">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/buttonView"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"
tools:ignore="NotSibling">
<Button
android:id="#+id/buttonSel1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_diarrhoeia_selected"
android:onClick="diarreaClick"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="#+id/textViewLoc"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="45dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/diarrea"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel1" />
<Button
android:id="#+id/buttonSel2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="160dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_vomiting_selected"
android:onClick="vomittingClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel1" />
<TextView
android:id="#+id/textViewLoc2"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="145dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/vomiting"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel2" />
<Button
android:id="#+id/buttonSel3"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="260dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_headache_selected"
android:onClick="headacheClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel2" />
<TextView
android:id="#+id/textViewLoc3"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="245dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/headache"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc2"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel3" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/buttonView2"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="15dp"
android:orientation="horizontal"
tools:ignore="NotSibling">
<Button
android:id="#+id/buttonSel4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_weakness_selected"
android:onClick="weaknessClick"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="#+id/textViewLoc4"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="45dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/weakness"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel4" />
<Button
android:id="#+id/buttonSel5"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="160dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_sweating_selected"
android:onClick="sweatingClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel4" />
<TextView
android:id="#+id/textViewLoc5"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="145dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/sweating"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc4"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel5" />
<Button
android:id="#+id/buttonSel6"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="260dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_tremors_selected"
android:onClick="tremorsClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel5" />
<TextView
android:id="#+id/textViewLoc6"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="245dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/tremors"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc5"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel6" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/buttonView3"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="15dp"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="#+id/buttonView2"
tools:ignore="NotSibling">
<Button
android:id="#+id/buttonSel7"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_fast_heart_beat_selected"
android:onClick="heartRateClick"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="#+id/textViewLoc7"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="45dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/fast_heart_rate"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel7" />
<Button
android:id="#+id/buttonSel8"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="160dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_fainting_selected"
android:onClick="faintingClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel7" />
<TextView
android:id="#+id/textViewLoc8"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="145dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/fainting"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc7"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel8" />
<Button
android:id="#+id/buttonSel9"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="260dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_irritability_selected"
android:onClick="irritabilityClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel8" />
<TextView
android:id="#+id/textViewLoc9"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="245dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/irritability"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc8"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel9" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/buttonView4"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="15dp"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="#+id/buttonView2"
tools:ignore="NotSibling">
<Button
android:id="#+id/buttonSel10"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_fast_heart_beat_selected"
android:onClick="heartRateClick"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="#+id/textViewLoc10"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="45dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/fast_heart_rate"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel10" />
<Button
android:id="#+id/buttonSel11"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="160dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_fainting_selected"
android:onClick="faintingClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel10" />
<TextView
android:id="#+id/textViewLoc11"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="145dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/fainting"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc10"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel11" />
<Button
android:id="#+id/buttonSel12"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="260dp"
android:layout_marginTop="10dp"
android:background="#drawable/ic_irritability_selected"
android:onClick="irritabilityClick"
app:layout_constraintLeft_toLeftOf="#id/buttonSel11" />
<TextView
android:id="#+id/textViewLoc12"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginLeft="245dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical|center_horizontal"
android:text="#string/irritability"
android:textAlignment="center"
android:textColor="#color/dialogHeaderLight"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="#+id/textViewLoc11"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/buttonSel12" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<Button
android:id="#+id/EnterButton"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#drawable/button_purple_rounded"
android:drawablePadding="25dp"
android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed"
android:gravity="center_horizontal|center_vertical"
android:onClick="enterDose"
android:paddingEnd="24dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingStart="24dp"
android:text="#string/enter"
android:textAlignment="gravity"
android:textColor="#color/dialogWhite"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="#+id/scrollViewWB"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
The problem is that only the first row of buttons appear ("#+id/buttonView") the remaining three rows don't appear. I've tried resizing the Scrollview but I cannot make all four rows appear in the Scrollview. What am I doing wrong?
Just add:
android:orientation="vertical"
to your
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
I have a layout with a ScrollView.When I change the picture of an ImageView or Text of TextView, layout refreshes and screen goes to the top.I Think the problem is in ScrollView.
XML file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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">
<ScrollView
android:id="#+id/sv2"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout 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"
android:background="#FFEEEEEE"
android:orientation="vertical"
android:padding="0dp"
tools:context="hamrahyper.rayanpejuhanparse.jamshidiasl.hamrahyper.Main3Activity">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFEEEEEE">
<EditText
android:id="#+id/editText3"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_toEndOf="#+id/imageViewx"
android:layout_toRightOf="#+id/imageViewx"
android:background="#color/colorPrimary"
android:ems="10"
android:gravity="center"
android:hint="جستجو در همراهایپر"
android:inputType="textPersonName"
android:textColor="#android:color/background_light"
android:textColorHint="#android:color/background_light"
android:textSize="14sp"
app:layout_constraintEnd_toStartOf="#+id/imageView1"
app:layout_constraintStart_toEndOf="#+id/imageViewx"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignEnd="#+id/editText3"
android:layout_alignRight="#+id/editText3"
android:layout_alignTop="#+id/editText3"
android:background="#color/colorPrimary"
android:padding="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/i1" />
<ImageView
android:id="#+id/imageViewx"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#color/colorPrimary"
app:layout_constraintStart_toEndOf="#+id/imageView10"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/icart2" />
<ViewFlipper
android:id="#+id/viewFlipper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autoStart="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText3">
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:srcCompat="#mipmap/btn1" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:srcCompat="#mipmap/btn2" />
</ViewFlipper>
<TextView
android:id="#+id/textView16"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:gravity="right"
android:text="دسته بندی محصولات"
android:textColor="#android:color/background_dark"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/viewFlipper" />
<HorizontalScrollView
android:id="#+id/sc1"
android:layout_width="0dp"
android:layout_height="220dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView16">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl1"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im1"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/im1"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/tv1"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl2"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im2"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im2"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv2"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl3"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im3"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/im3"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/tv3"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl4"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im4"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im4"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv4"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl5"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im5"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im5"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv5"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl6"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im6"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im6"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv6"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</HorizontalScrollView>
<ImageView
android:id="#+id/imageView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:layout_constraintTop_toBottomOf="#+id/sc1"
app:srcCompat="#mipmap/btn5"
tools:layout_editor_absoluteX="0dp" />
<TextView
android:id="#+id/textView17"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:gravity="right"
android:text="پرفروش ترین محصولات"
android:textColor="#android:color/background_dark"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView6" />
<TextView
android:id="#+id/textView19"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:background="#mipmap/bdr3"
android:gravity="center"
android:paddingLeft="1dp"
android:paddingTop="1dp"
android:textColor="#android:color/background_dark"
android:textSize="10sp"
app:layout_constraintStart_toEndOf="#+id/imageView10"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView10"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#color/colorPrimary"
android:paddingBottom="6dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingTop="6dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/menuicon" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</ScrollView>
I think the problem is ScrollView, so I set a focusable property of ScrollView to false but the problem not resolved.What is wrong?
Add this line android:fillViewport="true"
<ScrollView
android:fillViewport="true">
</ScrollView>
So i've got this layout. The problem is that i would like to make the indicated view fill the remaining space and have something like the one on the top, so that it touches the edge of the screen.
I've tried everything but apart from setting a fixed height the view doesn't get showed.
How can i do it? Sorry if the xml is quite long, the view is at the end. Thank you.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
android:background="#color/white"
android:id="#+id/coordinator_layout_new_configuration">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/relative_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="#+id/divider0"
android:layout_width="1dp"
android:layout_height="16dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="39dp"
android:background="#color/md_grey_400" />
<FrameLayout
android:id="#+id/icon1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/divider0"
android:layout_marginLeft="24dp"
android:visibility="visible">
<View
android:id="#+id/oval1"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/step_active" />
<TextView
android:id="#+id/number1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="1"
android:textColor="#color/white" />
<ImageView
android:id="#+id/done1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/ic_done_white_24dp"
android:visibility="gone" />
</FrameLayout>
<ImageView
android:id="#+id/warningIcon1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="24dp"
android:src="#drawable/ic_warning_red_500_36dp"
android:visibility="invisible" />
<TextView
android:id="#+id/title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/icon1"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon1"
android:fontFamily="sans-serif-medium"
android:text="#string/title1"
android:textColor="#color/primary_text"
android:textSize="16sp" />
<TextView
android:id="#+id/subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/title1"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon1"
android:text="#string/subtitle1"
android:textColor="#color/secondary_text"
android:textSize="14sp" />
<View
android:id="#+id/divider1"
android:layout_width="1dp"
android:layout_height="153dp"
android:layout_below="#+id/icon1"
android:layout_marginLeft="39dp"
android:layout_marginTop="8dp"
android:background="#color/md_grey_400" />
<android.support.design.widget.TextInputLayout
android:id="#+id/textInputLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/title1"
android:layout_below="#+id/subtitle1"
android:layout_marginRight="24dp"
android:layout_marginTop="16dp"
android:layout_toRightOf="#+id/divider1">
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textInputLayout1"
android:layout_alignStart="#+id/textInputLayout1"
android:layout_below="#+id/textInputLayout1"
android:layout_marginBottom="48dp"
android:backgroundTint="#color/colorAccent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_continue"
android:textColor="#color/white" />
<Button
android:id="#+id/button2"
style="#style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button1"
android:layout_marginLeft="8dp"
android:layout_toRightOf="#+id/button1"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_cancel" />
<FrameLayout
android:id="#+id/icon2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/divider1"
android:layout_marginLeft="24dp"
android:layout_marginTop="8dp">
<View
android:id="#+id/backgroundIcon2"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/step_inactive" />
<TextView
android:id="#+id/number2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="2"
android:textColor="#color/white" />
<ImageView
android:id="#+id/done2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/ic_done_white_24dp"
android:visibility="gone" />
</FrameLayout>
<TextView
android:id="#+id/title2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/icon2"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon2"
android:text="#string/title2"
android:textColor="#color/primary_text"
android:textSize="16sp" />
<TextView
android:id="#+id/subtitle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/title2"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon2"
android:text="#string/subtitle2"
android:textColor="#color/secondary_text"
android:textSize="14sp" />
<View
android:id="#+id/divider2"
android:layout_width="1dp"
android:layout_height="32dp"
android:layout_below="#+id/icon2"
android:layout_marginLeft="39dp"
android:layout_marginTop="8dp"
android:background="#color/md_grey_400" />
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignLeft="#+id/subtitle2"
android:layout_below="#+id/subtitle2"
android:layout_marginRight="24dp"
android:layout_marginTop="16dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:visibility="gone">
<ImageView
android:id="#+id/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:src="#drawable/ic_label_grey_24dp" />
<TextView
android:id="#+id/textViewRelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_toRightOf="#+id/image1"
android:text="#string/home"
android:textColor="#color/primary_text"
android:textSize="16sp" />
</RelativeLayout>
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/relativeLayout1"
android:layout_below="#+id/relativeLayout1"
android:layout_marginBottom="48dp"
android:backgroundTint="#color/colorAccent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_continue"
android:textColor="#color/white"
android:visibility="gone" />
<Button
android:id="#+id/button4"
style="#style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button3"
android:layout_marginLeft="8dp"
android:layout_toRightOf="#+id/button3"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_cancel"
android:visibility="gone" />
<FrameLayout
android:id="#+id/icon3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/divider2"
android:layout_marginLeft="24dp"
android:layout_marginTop="8dp">
<View
android:id="#+id/backgroundIcon3"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/step_inactive" />
<TextView
android:id="#+id/number3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="3"
android:textColor="#color/white" />
<ImageView
android:id="#+id/done3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/ic_done_white_24dp"
android:visibility="gone" />
</FrameLayout>
<TextView
android:id="#+id/title3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/icon3"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon3"
android:text="#string/title3"
android:textColor="#color/primary_text"
android:textSize="16sp" />
<TextView
android:id="#+id/subtitle3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/title3"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon3"
android:text="#string/subtitle3"
android:textColor="#color/secondary_text"
android:textSize="14sp" />
<View
android:id="#+id/divider3"
android:layout_width="1dp"
android:layout_height="32dp"
android:layout_below="#+id/icon3"
android:layout_marginLeft="39dp"
android:layout_marginTop="8dp"
android:background="#color/md_grey_400" />
<RelativeLayout
android:id="#+id/relativeLayout2"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignLeft="#+id/subtitle3"
android:layout_below="#+id/subtitle3"
android:layout_marginRight="24dp"
android:layout_marginTop="16dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:visibility="gone">
<ImageView
android:id="#+id/image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:src="#drawable/ic_zoom_out_map_grey_24dp" />
<TextView
android:id="#+id/textViewRelativeLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_toRightOf="#+id/image2"
android:text="#string/mid_tower"
android:textColor="#color/primary_text"
android:textSize="16sp" />
</RelativeLayout>
<Button
android:id="#+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/relativeLayout2"
android:layout_below="#+id/relativeLayout2"
android:layout_marginBottom="48dp"
android:backgroundTint="#color/colorAccent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_continue"
android:textColor="#color/white"
android:visibility="gone" />
<Button
android:id="#+id/button6"
style="#style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button5"
android:layout_marginLeft="8dp"
android:layout_toRightOf="#+id/button5"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_cancel"
android:visibility="gone" />
<FrameLayout
android:id="#+id/icon4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/divider3"
android:layout_marginLeft="24dp"
android:layout_marginTop="8dp">
<View
android:id="#+id/backgroundIcon4"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/step_inactive" />
<TextView
android:id="#+id/number4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="4"
android:textColor="#color/white" />
<ImageView
android:id="#+id/done4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/ic_done_white_24dp"
android:visibility="gone" />
</FrameLayout>
<TextView
android:id="#+id/title4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/icon4"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon4"
android:text="#string/title4"
android:textColor="#color/primary_text"
android:textSize="16sp" />
<TextView
android:id="#+id/subtitle4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/title4"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon4"
android:text="#string/subtitle4"
android:textColor="#color/secondary_text"
android:textSize="14sp" />
<View
android:id="#+id/divider4"
android:layout_width="1dp"
android:layout_height="32dp"
android:layout_below="#+id/icon4"
android:layout_marginLeft="39dp"
android:layout_marginTop="8dp"
android:background="#color/md_grey_400" />
<RelativeLayout
android:id="#+id/relativeLayout3"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignLeft="#+id/subtitle4"
android:layout_below="#+id/subtitle4"
android:layout_marginRight="24dp"
android:layout_marginTop="16dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:visibility="gone">
<ImageView
android:id="#+id/image3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:src="#drawable/ic_account_balance_wallet_grey_24dp" />
<TextView
android:id="#+id/textViewRelativeLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_toRightOf="#+id/image3"
android:text="#string/home_mid_budget"
android:textColor="#color/primary_text"
android:textSize="16sp" />
</RelativeLayout>
<Button
android:id="#+id/button7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/relativeLayout3"
android:layout_below="#+id/relativeLayout3"
android:layout_marginBottom="48dp"
android:backgroundTint="#color/colorAccent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_continue"
android:textColor="#color/white"
android:visibility="gone" />
<Button
android:id="#+id/button8"
style="#style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button7"
android:layout_marginLeft="8dp"
android:layout_toRightOf="#+id/button7"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_cancel"
android:visibility="gone" />
<FrameLayout
android:id="#+id/icon5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/divider4"
android:layout_marginLeft="24dp"
android:layout_marginTop="8dp">
<View
android:id="#+id/backgroundIcon5"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="#drawable/step_inactive" />
<TextView
android:id="#+id/number5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="5"
android:textColor="#color/white" />
</FrameLayout>
<TextView
android:id="#+id/title5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/icon5"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon5"
android:text="#string/title5"
android:textColor="#color/primary_text"
android:textSize="16sp" />
<TextView
android:id="#+id/subtitle5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/title5"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/icon5"
android:text="#string/subtitle5"
android:textColor="#color/secondary_text"
android:textSize="14sp" />
<Button
android:id="#+id/button9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/subtitle5"
android:layout_below="#+id/subtitle5"
android:layout_marginBottom="48dp"
android:layout_marginTop="16dp"
android:backgroundTint="#color/colorAccent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_finish"
android:textColor="#color/white"
android:visibility="gone" />
<Button
android:id="#+id/button10"
style="#style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button9"
android:layout_marginLeft="8dp"
android:layout_toRightOf="#+id/button9"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/step_cancel"
android:visibility="gone" />
<!--this one-->
<View
android:id="#+id/divider5"
android:layout_width="1dp"
android:layout_height="50dp"
android:layout_below="#id/icon5"
android:layout_marginLeft="39dp"
android:layout_marginTop="8dp"
android:background="#color/md_grey_400" />
</RelativeLayout>
</ScrollView>
</android.support.design.widget.CoordinatorLayout>
I developed an android application in which the scroll-view is not scrolling.. I am posting the code here please check and if found any error please help.. Here I used ScrollView as root and then LinearLayout... but this is not scrolling up.. I Updated the xml still not working
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center|top"
android:orientation="vertical"
android:background="#color/colorPrimary"
android:weightSum="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="#+id/arrowImageView"
android:src="#drawable/logo_grey"
/>
<TextView
android:id="#+id/NameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="20dp"
android:textStyle="bold"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/dTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/positionTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/IdTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_id"
android:textSize="15dp"
android:layout_marginBottom="#dimen/activity_vertical_margin"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<!--items-->
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image1"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:src="#drawable/takeoff_color"
android:layout_alignParentStart="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_b"
android:textSize="15dp"
android:layout_toEndOf="#id/image1"
android:textStyle="bold"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/sTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_date"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image2"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/DateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_end_of"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image3"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/endOfTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:gravity="start"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/ic_action_money"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_c"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/currentSalaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/bag_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_h_total"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView2"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/salaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/purchase_order"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_g"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView3"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/gTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
EDITED AS BELOW, but still not working well, the scrollbar stop at half of label name:"label_h_total"
<ScrollView 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:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:orientation="vertical"
android:background="#color/colorPrimary"
>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="#+id/arrowImageView"
android:src="#drawable/logo_grey"
/>
<TextView
android:id="#+id/NameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="20dp"
android:textStyle="bold"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/dTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/positionTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/IdTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_id"
android:textSize="15dp"
android:layout_marginBottom="#dimen/activity_vertical_margin"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<!--items-->
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image1"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:src="#drawable/takeoff_color"
android:layout_alignParentStart="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_b"
android:textSize="15dp"
android:layout_toEndOf="#id/image1"
android:textStyle="bold"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/sTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_date"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image2"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/DateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_end_of"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image3"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/endOfTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:gravity="start"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/ic_action_money"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_c"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/currentSalaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/bag_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_h_total"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView2"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/salaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/purchase_order"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_g"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView3"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/gTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
The Warning
A scrolling widget such as a ScrollView should not contain any nested scrolling widgets since this has various usability issues
This should be works. There was a problem with the LinearLayout, the height was wrap_content. The first child of scrollview needs to have only match_parent for both width and height and that's it.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#color/colorPrimary">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="#+id/arrowImageView"
android:src="#drawable/logo_grey"
/>
<TextView
android:id="#+id/NameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="20dp"
android:textStyle="bold"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/dTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/positionTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/IdTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_id"
android:textSize="15dp"
android:layout_marginBottom="#dimen/activity_vertical_margin"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<!--items-->
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image1"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:src="#drawable/takeoff_color"
android:layout_alignParentStart="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_b"
android:textSize="15dp"
android:layout_toEndOf="#id/image1"
android:textStyle="bold"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/sTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_date"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image2"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/DateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_end_of"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image3"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/endOfTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:gravity="start"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/ic_action_money"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_c"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/currentSalaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/bag_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_h_total"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView2"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/salaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/purchase_order"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_g"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView3"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/gTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center|top"
android:orientation="vertical"
android:background="#color/colorPrimary"
android:weightSum="1">
xmlns:tools="http://schemas.android.com/tools" put this in scrollview and edit child of scrollview.