Good day.I have an set of buttons which should be aligned to the bottom always,but they all also should be below an text,and it goes like this,if text is large,it is going just to push the buttons inside the scrollview,otherwise the buttons should be aligned to the parent bottom.Issue is that i add both of the tags to the linear layout wrapper of the buttons,but as soon as i set visibility of text to gone,the view just pops up and not aligning to parent bottom,here is the actual code,
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/single_product_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/single_product_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:src="#drawable/img_placeholder" />
<RelativeLayout
android:id="#+id/basket_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/single_product_divider"
android:layout_alignEnd="#+id/single_product_divider"
android:layout_alignLeft="#+id/single_product_divider"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/single_product_divider"
android:layout_alignStart="#+id/single_product_divider"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:visibility="gone">
<ImageView
android:id="#+id/basket_success_icon"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_centerVertical="true"
android:layout_marginLeft="26dp"
android:src="#drawable/success_icon" />
<TextView
android:id="#+id/basket_product_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/basket_success_icon"
android:layout_marginLeft="16dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/basket_success_icon"
android:text="#string/product_added_to_basket_text"
android:textColor="#ffffff"
android:textSize="16sp" />
</RelativeLayout>
<View
android:id="#+id/single_product_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/single_product_image"
android:layout_margin="25dp"
android:background="#D1D3D4">
</View>
<TextView
android:id="#+id/single_product_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/single_product_divider"
android:layout_alignStart="#+id/single_product_divider"
android:layout_below="#+id/single_product_divider"
android:text="#string/loading_text"
android:textColor="#231F20" />
<TextView
android:id="#+id/single_product_weight_and_servings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/single_product_divider"
android:layout_alignStart="#+id/single_product_divider"
android:layout_below="#+id/single_product_name"
android:layout_marginTop="5dp"
android:text="#string/weight_and_servings_text"
android:textColor="#231F20" />
<TextView
android:id="#+id/single_product_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/single_product_weight_and_servings"
android:layout_alignStart="#+id/single_product_weight_and_servings"
android:layout_below="#+id/single_product_weight_and_servings"
android:layout_marginTop="15dp"
android:text="$12.09"
android:textColor="#009444"
android:textSize="17sp"
android:textStyle="bold" />
<RatingBar
android:id="#+id/single_product_rating"
style="#style/Base.Widget.AppCompat.RatingBar.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/single_product_price"
android:layout_alignStart="#+id/single_product_price"
android:layout_below="#+id/single_product_price"
android:layout_marginTop="5dp"
android:numStars="5" />
<TextView
android:id="#+id/single_product_rating_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/single_product_rating"
android:layout_marginLeft="5dp"
android:layout_toRightOf="#+id/single_product_rating"
android:text="10.0/10"
android:textColor="#231F20"
android:textSize="12sp" />
<TextView
android:id="#+id/single_product_review_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/single_product_rating_text"
android:layout_marginLeft="5dp"
android:layout_toRightOf="#+id/single_product_rating_text"
android:text="8 reviews"
android:textColor="#EC2027"
android:textSize="12sp" />
<TextView
android:id="#+id/single_product_stock_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/single_product_review_count"
android:layout_marginRight="10dp"
android:text="In stock"
android:textColor="#939598" />
<View
android:id="#+id/single_product_center_divider"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_below="#+id/single_product_rating"
android:layout_centerHorizontal="true"></View>
<Spinner
android:id="#+id/single_product_weight_spinner"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/single_product_rating"
android:layout_marginLeft="10dp"
android:layout_marginRight="2dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#+id/single_product_center_divider"
android:background="#drawable/spinner_background"
android:spinnerMode="dropdown"></Spinner>
<Spinner
android:id="#+id/single_product_type_spinner"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_below="#+id/single_product_rating"
android:layout_marginLeft="2dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/single_product_center_divider"
android:background="#drawable/spinner_background"
android:spinnerMode="dropdown"></Spinner>
<TextView
android:id="#+id/single_product_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/single_product_type_spinner"
android:layout_margin="16dp"
android:text="This is simply the best tripod for the money you\'ll ever buy,it\'s rock solid and the head alone is worth more then the asking price"
android:textColor="#231F20" />
<RelativeLayout
android:id="#+id/single_product_buttons_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/single_product_description"
android:orientation="vertical">
<Button
android:id="#+id/single_product_add_to_cart_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#F26522"
android:text="#string/add_to_cart_text"
android:textAllCaps="false"
android:textColor="#ffffff" />
<Button
android:id="#+id/single_product_info_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/single_product_add_to_cart_button"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:background="#E7E8E9"
android:drawableRight="#drawable/ic_arrow_down"
android:paddingRight="10dp"
android:text="#string/product_info_text"
android:textAllCaps="false"
android:textColor="#231F20" />
<Button
android:id="#+id/single_product_nutritional_info_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/single_product_info_button"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:background="#E7E8E9"
android:drawableRight="#drawable/ic_arrow_down"
android:paddingRight="10dp"
android:text="#string/product_nutritional_text"
android:textAllCaps="false"
android:textColor="#231F20" />
<Button
android:id="#+id/single_product_reviews_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/single_product_nutritional_info_button"
android:layout_marginBottom="5dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:background="#E7E8E9"
android:drawableRight="#drawable/ic_arrow_down"
android:paddingRight="10dp"
android:text="#string/product_reviews_text"
android:textAllCaps="false"
android:textColor="#231F20" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
Can anyone please give any suggestion?
Edit : The full code of the view,actual buttons are inside RelativeLayout at the bottom of xml files there are 4 of buttons.The wrapper is single_product_buttons_wrapper
Add android:gravity="bottom" to LinearLayout containing buttons. It will work have tested it.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/single_product_description"
android:gravity="bottom"
android:orientation="vertical">
Try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true">
<TextView
android:id="#+id/single_product_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="This is simply the best tripod for the money you\'ll ever buy,it\'s rock solid and the head alone is worth more then the asking price"
android:textColor="#231F20" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<Button
android:id="#+id/single_product_add_to_cart_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/single_product_info_button"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#F26522"
android:text="123"
android:textAllCaps="false"
android:textColor="#ffffff" />
<Button
android:id="#+id/single_product_info_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/single_product_nutritional_info_button"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:background="#E7E8E9"
android:paddingRight="10dp"
android:text="234"
android:textAllCaps="false"
android:textColor="#231F20" />
<Button
android:id="#+id/single_product_nutritional_info_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/single_product_reviews_button"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:background="#E7E8E9"
android:paddingRight="10dp"
android:text="5555"
android:textAllCaps="false"
android:textColor="#231F20" />
<Button
android:id="#+id/single_product_reviews_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:background="#E7E8E9"
android:paddingRight="10dp"
android:text="99999"
android:textAllCaps="false"
android:textColor="#231F20" />
</LinearLayout>
</RelativeLayout>
Related
I have a LinearLayout activity that contains two contents which are CardView 1 and CardView 2. Everything is doing well, also with NestedScrollView. But I have problem in the last RecycleView data, it is cutting off a little bit in very bottom.
I already tried many solution that I have searched for in Stack Overflow and this still doing bad. I'm new in this, please help
This is my xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.yehezkiel.eclassapp.MateriActivity"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_nilai"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
My Custom RecyclerView
<?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"
android:layout_width="fill_parent"
android:layout_height="90dp"
android:background="#color/white"
android:padding="10dip">
<TextView
android:id="#+id/nama_nilai"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignWithParentIfMissing="true"
android:layout_toStartOf="#+id/view_2"
android:gravity="center_vertical"
android:text="Pemrogaman Web Tugas 1"
android:textColor="#5e1b2c"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:id="#+id/view_2"
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="14dp"
android:layout_toStartOf="#+id/imageView10"
android:background="#c0c0c0" />
<TextView
android:id="#+id/bobot_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#+id/imageView8"
android:textAlignment="center"
android:layout_marginTop="0.5dp"
android:ellipsize="end"
android:gravity="center"
android:text="Bobot"
android:textColor="#555555"
android:textSize="8sp" />
<ImageView
android:id="#+id/imageView8"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignEnd="#+id/bobot_layout"
android:layout_below="#+id/nama_nilai"
android:layout_marginTop="8dp"
app:srcCompat="#drawable/percentage" />
<TextView
android:id="#+id/bobot_nilai"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView8"
android:layout_alignTop="#+id/percent"
android:layout_marginStart="8dp"
android:layout_toEndOf="#+id/bobot_layout"
android:text="5.00" />
<TextView
android:id="#+id/percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView8"
android:layout_toEndOf="#+id/bobot_nilai"
android:text="%"
android:layout_marginStart="2dp"/>
<ImageView
android:id="#+id/imageView9"
android:layout_width="23dp"
android:layout_height="23dp"
android:layout_alignBottom="#+id/percent"
android:layout_marginStart="9dp"
android:layout_toEndOf="#+id/percent"
app:srcCompat="#drawable/equality" />
<TextView
android:id="#+id/skala_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/imageView9"
android:layout_alignStart="#+id/imageView9"
android:layout_below="#+id/imageView9"
android:layout_marginTop="1dp"
android:ellipsize="end"
android:gravity="center"
android:text="Skala"
android:textAlignment="center"
android:textColor="#555555"
android:textSize="8sp" />
<TextView
android:id="#+id/skala_nilai"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/skala_layout"
android:layout_marginStart="8dp"
android:layout_toEndOf="#+id/imageView9"
android:text="100.00" />
<ImageView
android:id="#+id/imageView10"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_below="#+id/nama_nilai"
android:layout_toStartOf="#+id/nilai_nilai"
app:srcCompat="#drawable/score" />
<TextView
android:id="#+id/nilai_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/imageView10"
android:layout_toStartOf="#+id/nilai_nilai"
android:ellipsize="end"
android:text="Nilai"
android:textAlignment="center"
android:textColor="#555555"
android:textSize="12sp" />
<TextView
android:id="#+id/nilai_nilai"
android:layout_width="90dp"
android:layout_height="50dp"
android:layout_alignBottom="#+id/nilai_layout"
android:layout_alignParentEnd="true"
android:layout_below="#+id/information"
android:text="89.70"
android:padding="15dp"
android:textAlignment="center"
android:textSize="18sp" />
<ImageView
android:id="#+id/information"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_alignEnd="#+id/nilai_nilai"
android:layout_alignParentTop="true"
app:srcCompat="#drawable/information" />
</RelativeLayout>
I don't think it's overwritten but I think the textview is hiding behind the card itself since its in a relative layout.
Can you try adding layout below attribute in your cardview and assign the ID of the textview "static1"
Let me know how it goes.
I need your help!
I have an activity which supposed to be scrollable,
Therefore the ScrollView is the top layout(i hope this is how you call it).
I used android:fillViewport="true" on the ScrollView
-The ScrollView's child is a LinearLayout with a couple of more nested LinearLayouts.
Now my problem is that on the preview screen(Design) i see my layout fine
but when i run the app on an Emulator,i only see half of my layout (until the first nested LinearLayout) and as a collateral damage, the scrollview isn't scrollable.
Thanks in advance for the help!
Design Screen Image:
[At the preview screen it looks good]
Emulator Screen Image:
[As you can see ,only half of the scrollview's content is showing ]
Updated layout file:(still showing only half of the layout at runtime)
Added:
- tools:context=
- ScrollView changed from layout_height="wrap_content" to
layout_height="match_parent"
Removed all instances of weight="1" from all nested LinearLayouts.
AddParkingActivity.xml:
xml version="1.0" encoding="utf-8"
<ScrollView
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#FFA3D2E9"
android:clickable="true"
android:clipToPadding="false"
android:fillViewport="true"
android:focusable="true"
android:layoutDirection="rtl">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:orientation="vertical"
android:textDirection="rtl">
<TextView
android:id="#+id/addParkingActivity_tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="20dp"
android:layout_marginBottom="16dp"
android:layout_marginTop="23dp"
android:fontFamily="cursive"
android:text="הוספת חנייה חדשה למסד הנתונים"
android:textAlignment="center"
android:textColor="#android:color/white"
android:textSize="24sp"
android:textStyle="bold"
android:typeface="monospace" />
<EditText
android:id="#+id/addParkingActivity_Name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="שם החניון"
android:inputType="textPersonName"
android:paddingHorizontal="16dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="18sp" />
<EditText
android:id="#+id/addParkingActivity_area"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="אזור מפורט"
android:inputType="textPersonName"
android:paddingHorizontal="16dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="18sp" />
<Spinner
android:id="#+id/addParkingActivity_subAreaSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:paddingHorizontal="16dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="18sp" />
<View
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#FF909090" />
<LinearLayout
android:id="#+id/ll_radioG1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:background="#FFA3D2E9"
android:gravity="center_horizontal"
android:layoutDirection="rtl"
android:orientation="horizontal"
android:textDirection="rtl">
<RadioButton
android:id="#+id/addParkingActivity_crewAcc_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/radioLeft"
android:text="לינה לצוות"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_water_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="6dp"
android:text="מים"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_showers_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="6dp"
android:text="מקלחות"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_accessibility_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="6dp"
android:text="נגישות"
android:textColor="#000"
android:textDirection="rtl" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#FF909090" />
<LinearLayout
android:id="#+id/ll_radioG2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:background="#FFA3D2E9"
android:gravity="center_horizontal"
android:layoutDirection="rtl"
android:orientation="horizontal"
android:textDirection="rtl">
<RadioButton
android:id="#+id/addParkingActivity_fence_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:paddingLeft="#dimen/radioLeft"
android:text="גדר"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_toilets_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:text="שירותים"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_cookingPos_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:text="עמדות בישול"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_equipmentToBor_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:text="ציוד להשאלה"
android:textColor="#000"
android:textDirection="rtl" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#FF909090" />
<LinearLayout
android:id="#+id/ll_radioG3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:background="#FFA3D2E9"
android:gravity="center_horizontal"
android:layoutDirection="rtl"
android:orientation="horizontal"
android:textDirection="rtl">
<RadioButton
android:id="#+id/addParkingActivity_electricity_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:paddingLeft="#dimen/radioLeft"
android:text="חשמל ותאורה"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_securityServ_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:text="שירותי אבטחה"
android:textColor="#000"
android:textDirection="rtl" />
<RadioButton
android:id="#+id/addParkingActivity_medicalServ_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:paddingLeft="6dp"
android:text="שירותי רפואה"
android:textColor="#000"
android:textDirection="rtl" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#FF909090" />
<LinearLayout
android:id="#+id/ll_radioG5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:background="#FFA3D2E9"
android:gravity="center_horizontal"
android:layoutDirection="rtl"
android:orientation="horizontal"
android:textDirection="rtl">
<Button
android:id="#+id/addParkingActivity_buttonMarkAll"
android:layout_width="49dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:background="#drawable/roundedbutton"
android:onClick="onMarkAllClick"
android:text="סמן הכל" />
<Button
android:id="#+id/addParkingActivity_buttonUNMarkAll"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:background="#drawable/roundedbutton"
android:onClick="onUNMarkAllClick"
android:text="אפס כפתורים" />
</LinearLayout>
<EditText
android:id="#+id/addParkingActivity_securityOrganization"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="#string/securityOrg"
android:paddingHorizontal="16dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="18sp" />
<EditText
android:id="#+id/addParkingActivity_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="הערות נוספות"
android:paddingHorizontal="16dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="18sp" />
<LinearLayout
android:id="#+id/ll_radioG6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:background="#FFA3D2E9"
android:gravity="center_horizontal"
android:layoutDirection="rtl"
android:orientation="horizontal"
android:textDirection="rtl">
<EditText
android:id="#+id/addParkingActivity_googleMapsY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="ערך עשרוני שני \n בגוגל מפות"
android:inputType="number"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="12sp" />
<EditText
android:id="#+id/addParkingActivity_googleMapsX"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="ערך עשרוני ראשון \n בגוגל מפות"
android:inputType="number"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="12sp" />
</LinearLayout>
<EditText
android:id="#+id/addParkingActivity_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="סוג חניון או בעלות"
android:paddingHorizontal="16dp"
android:textColor="#ffff"
android:textDirection="rtl"
android:textSize="18sp" />
<LinearLayout
android:id="#+id/ll_radioG4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:background="#FFA3D2E9"
android:gravity="center_horizontal"
android:layoutDirection="rtl"
android:orientation="horizontal"
android:textDirection="rtl">
<Button
android:id="#+id/addParkingActivity_buttonADD_PARKING"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:background="#drawable/roundedbutton"
android:onClick="onAddParkingPressed"
android:text=" הוסף חנייה"
android:textAlignment="center"
android:textColor="#android:color/white"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="50dp" />
</LinearLayout>
</ScrollView>
First, I believe you are missing the 'android' namespace declaration:
xmlns:android="http://schemas.android.com/apk/res/android"
Should go in your ScrollView.
Second, I would make the ScrollView take up the entire screen so change it's height from:
android:layout_height="wrap_content"
to "match_parent":
android:layout_height="match_parent"
Also, remove the layout_weight from all the elements that should be vertically stacked. I see these: ll_radioG1, ll_radioG2, ll_radioG3, ll_radioG5, ll_radioG6, ll_radioG4
You're basically asking those widgets to expand infinitely, because in a ScrollView you have unbounded vertical space.
Ok this is really weird but i fixed the issue by coping the xml code to another layout file. I guess the first xml file got corrupted after doing a lot of changes and importing a lot of libraries. Thank you #DataDino for the help!
i am having an issue in over-lapping layouts,i am trying to implement an login form with in the entire page , and a button at the bottom , when the user press this button a registration form slides from bottom to up , my problems are:the first the registration form push the entire screen (i want it to overflow), the second: that i have 2 buttons with a shape background that appears on the top of registration form and the login inputs remains active
my xml code
<?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:id="#+id/content_login_page"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg"
tools:context="com.example.a3wd.mytest10.LoginPage"
tools:showIn="#layout/activity_login_page">
<ImageView
android:id="#+id/login2Logo"
android:layout_width="50dp"
android:layout_height="70dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:contentDescription="#string/fixawy_logoPic"
android:src="#drawable/logo2" />
<LinearLayout
android:id="#+id/loginInputs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/login2Logo"
android:layout_marginTop="30dp"
android:orientation="vertical">
<TextView
android:layout_width="140dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:text="#string/loginText"
android:textColor="#color/loginText"
android:textSize="24sp"
android:textStyle="bold" />
<EditText
android:id="#+id/userEmail"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginEnd="50dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginStart="50dp"
android:layout_marginTop="10dp"
android:background="#drawable/myspinner"
android:hint="#string/nameHint"
android:inputType="textEmailAddress"
android:padding="10dp" />
<EditText
android:id="#+id/userPassword"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginEnd="50dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginStart="50dp"
android:layout_marginTop="8dp"
android:background="#drawable/myspinner"
android:hint="#string/passwordHint"
android:inputType="textPassword"
android:padding="10dp"
android:textAlignment="textEnd" />
</LinearLayout>
<Button
android:id="#+id/loginBtn"
android:layout_width="96dp"
android:layout_height="56dp"
android:layout_below="#id/loginInputs"
android:layout_marginLeft="50dp"
android:layout_marginTop="20dp"
android:background="#drawable/shape_round_corner"
android:text="#string/enterBtnTxt"
/>
<TextView
android:id="#+id/passwordText"
android:layout_width="150dp"
android:layout_height="30dp"
android:layout_alignBaseline="#id/loginBtn"
android:layout_alignParentRight="true"
android:layout_below="#id/loginInputs"
android:layout_marginRight="50dp"
android:text="#string/forgetPassword"
android:textColor="#color/loginText"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/facebookTxt"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_below="#id/loginBtn"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="#string/facebookTxt"
android:textSize="18sp" />
<Button
android:id="#+id/facebookBtn"
android:layout_width="88dp"
android:layout_height="32dp"
android:layout_below="#id/facebookTxt"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/facebookbtn"
android:text="#string/facebook_btn"
android:textColor="#ffffff" />
<TextView
android:id="#+id/newUserTxt"
android:layout_width="140dp"
android:layout_height="20dp"
android:paddingEnd="10dp"
android:paddingRight="10dp"
android:text="#string/newUserTxt"
android:textSize="18sp"
android:layout_marginBottom="5dp"
android:layout_alignParentRight="true"
android:layout_above="#+id/registrationBtn"
/>
<Button
android:id="#id/registrationBtn"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#drawable/register_btn_shape"
android:gravity="right"
android:onClick="registerFragment"
android:layout_alignParentBottom="true"
android:paddingEnd="40dp"
android:paddingRight="30dp"
android:paddingTop="10dp"
android:text="#string/registerTxt"
android:textColor="#874f13"
android:textSize="24sp"/>
<LinearLayout
android:id="#+id/registerForm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/newUserTxt"
android:background="#drawable/register_back"
android:orientation="vertical"
android:visibility="invisible"
>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="right"
android:paddingEnd="40dp"
android:paddingRight="40dp"
android:paddingTop="10dp"
android:text="#string/registerTxt"
android:textColor="#874f13"
android:textSize="24sp"
/>
</LinearLayout>
</RelativeLayout>
and the java code for animation
Animation bottomUp = AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.bottom_up);
registrationForm.startAnimation(bottomUp);
registrationForm.setVisibility(View.VISIBLE);
this is the original view
and this is an image of the problem
Please view the image below:
The first image is the layout I did and it show normally on my device and another test devices. The second image is the layout showed on my friend device, it is reversed. I do not know why, and it just happened on few devices.
This is my layout code on xml.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:auto="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.ComposeSmsActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar_action" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="#dimen/padding_5">
<com.hnib.smslater.views.FlowLayout
android:id="#+id/layout_name_recipient"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_10"
android:fontFamily="sans-serif-light"
android:orientation="horizontal">
</com.hnib.smslater.views.FlowLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="#dimen/padding_10">
<com.hnib.smslater.views.ClearableAutoContactCompleteTextView
android:id="#+id/et_recipient"
android:layout_width="#dimen/width_et_contact"
android:layout_height="#dimen/height_et_default"
android:layout_centerVertical="true"
android:layout_marginTop="#dimen/margin_10"
android:background="#drawable/drawable_radius_gray_gray"
android:fontFamily="sans-serif-light"
android:hint="#string/to_"
android:imeOptions="actionDone"
android:padding="#dimen/padding_5"
android:textColorHint="#color/gray"
android:textSize="18sp"
android:textStyle="bold"
auto:displayPhotoIfAvailable="false"
auto:styleOfTypedLetters="bold"
auto:typeOfData="phone"
auto:typedLettersHaveDifferentStyle="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/margin_5"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:fontFamily="sans-serif-light"
android:text="#string/message"
android:textColor="#color/gray"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_message_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-light"
android:text="160/1" />
</RelativeLayout>
<com.hnib.smslater.views.ActionEditText
android:id="#+id/et_text_content"
android:layout_width="match_parent"
android:layout_height="#dimen/height_et_big"
android:layout_marginLeft="#dimen/margin_5"
android:background="#drawable/drawable_radius_gray_gray"
android:ems="10"
android:fontFamily="sans-serif-light"
android:gravity="top"
android:inputType="textMultiLine"
android:maxLines="10"
android:padding="#dimen/padding_5"
android:scrollbars="vertical" />
<RelativeLayout
android:id="#+id/layout_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="#dimen/padding_10"
android:showDividers="middle">
<TextView
android:id="#+id/tv_title_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="#drawable/drawable_radius_acent_gray"
android:fontFamily="sans-serif-light"
android:padding="#dimen/padding_5"
android:text="#string/time"
android:textAllCaps="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="#+id/tv_title_time"
android:divider="?android:attr/dividerVertical"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="#dimen/padding_10"
android:showDividers="middle">
<TextView
android:id="#+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/selector_textview"
android:fontFamily="sans-serif-light"
android:gravity="center_horizontal"
android:text="12/06/2016"
android:textColor="#color/gray"
android:textSize="27sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/selector_textview"
android:fontFamily="sans-serif-light"
android:gravity="center_horizontal"
android:text="09:10"
android:textColor="#color/gray"
android:textSize="27sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="#dimen/padding_10">
<TextView
android:id="#+id/tv_title_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="30dp"
android:background="#drawable/drawable_radius_acent_gray"
android:fontFamily="sans-serif-light"
android:padding="#dimen/padding_5"
android:text="#string/repeat"
android:textAllCaps="true" />
<Spinner
android:id="#+id/spinner_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Spinner>
</LinearLayout>
<LinearLayout
android:id="#+id/layout_choose_sim"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="#dimen/padding_10">
<TextView
android:id="#+id/title_choose_sim"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="30dp"
android:background="#drawable/drawable_radius_acent_gray"
android:fontFamily="sans-serif-light"
android:padding="#dimen/padding_5"
android:text="#string/choose_sim"
android:textAllCaps="true" />
<Spinner
android:id="#+id/spinner_choose_sim"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Spinner>
</LinearLayout>
<LinearLayout
android:id="#+id/layout_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="#dimen/padding_10">
<TextView
android:id="#+id/tv_title_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:background="#drawable/drawable_radius_acent_gray"
android:fontFamily="sans-serif-light"
android:padding="#dimen/padding_5"
android:text="#string/ask_before_send"
android:textAllCaps="true" />
<CheckBox
android:id="#+id/checkbox_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/tv_title_confirm" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Please have a help on this issue. Thanks.
The language on your friend's phone is probably different from yours, leading to the app giving a read from right to left, rather than your left to right. Does your friend have his phone's settings on language set to Hebrew or Arabic?
Edit: please take note of the answers below mine, those are the viable options for your friend's phone, besides for changing the language of course.
You should remove android:supportsRtl="true"
from the <application> element in your AndroidManifest.xml file.
You should ADD : android:supportRTL="false"
In the manifest
I am going through a peculiar problem. I have multiple EditText inside a RelativeLayout which is ultimately inside a ScrollView. My problem is that whenever I edit the second(or third and so on) EditText, it loses focus to the first EditText inside the ScrollView and this first EditText gets the keyboard input.
Here goes the xml layout:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/particularsLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<TextView
android:id="#+id/particularsTextView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PARTICULARS"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
/>
<View
android:id="#+id/bar1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray"
android:layout_below="#+id/particularsTextView"
/>
<RelativeLayout
android:id="#+id/particularsParentRelativeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/bar1"
android:layout_marginTop="10dp"
>
<EditText
android:id="#+id/nameEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="15dp"
android:layout_alignLeft="#+id/confirmPasswordEditText"
/>
<TextView
android:id="#+id/nameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NAME"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_alignBottom="#+id/nameEditText"
android:layout_marginBottom="15dp"
android:textSize="12sp"
/>
<TextView
android:id="#+id/passwordTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PASSWORD"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_alignBottom="#+id/passwordEditText"
android:layout_marginBottom="15dp"
android:textSize="12sp"
/>
<EditText
android:id="#+id/passwordEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/nameEditText"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/passwordTextView"
android:layout_alignParentRight="true"
android:nextFocusUp="#+id/passwordEditText"
android:layout_alignLeft="#+id/confirmPasswordEditText"
/>
<TextView
android:id="#+id/confirmPasswordTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CONFIRM PASSWORD"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_alignBottom="#+id/confirmPasswordEditText"
android:layout_marginBottom="15dp"
android:textSize="12sp"
/>
<EditText
android:id="#+id/confirmPasswordEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/passwordEditText"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/confirmPasswordTextView"
android:layout_alignParentRight="true"
android:layout_marginLeft="5dp"
/>
<TextView
android:id="#+id/birthdayTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BIRTHDAY"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_alignBottom="#+id/birthdayEditText"
android:layout_marginBottom="15dp"
android:textSize="12sp"
/>
<EditText
android:id="#+id/birthdayEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/confirmPasswordEditText"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/birthdayTextView"
android:layout_alignParentRight="true"
android:layout_alignLeft="#+id/confirmPasswordEditText"
/>
<TextView
android:id="#+id/genderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GENDER"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_marginTop="18dp"
android:layout_below="#+id/birthdayTextView"
android:textSize="12sp"
/>
<TextView
android:id="#+id/contactDetailsTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/genderTextView"
android:text="CONTACT DETAILS"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_marginTop="50dp"
/>
<View
android:id="#+id/bar2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray"
android:layout_below="#+id/contactDetailsTextView"
/>
<TextView
android:id="#+id/contactNoTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/contactNoEditText"
android:layout_marginBottom="15dp"
android:text="CONTACT NO."
android:textSize="12sp"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
/>
<EditText
android:id="#+id/contactNoEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bar2"
android:layout_marginTop="15dp"
android:layout_alignParentRight="true"
android:layout_alignLeft="#+id/confirmPasswordEditText"
/>
<TextView
android:id="#+id/emailAddressTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EMAIL AD."
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_alignBottom="#+id/emailAddressEditText"
android:layout_marginBottom="15dp"
android:textSize="12sp"
/>
<EditText
android:id="#+id/emailAddressEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/contactNoEditText"
android:layout_marginTop="10dp"
android:layout_alignParentRight="true"
android:layout_alignLeft="#+id/confirmPasswordEditText"
/>
<EditText
android:id="#+id/emailAddressEditText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/emailAddressTextView"
android:layout_marginTop="10dp"
android:layout_alignParentRight="true"
android:layout_alignLeft="#+id/confirmPasswordEditText"
/>
<TextView
android:id="#+id/countryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="COUNTRY"
android:textColor="#android:color/darker_gray"
android:textStyle="bold"
android:layout_below="#+id/emailAddressEditText2"
android:layout_marginTop="18dp"
android:textSize="12sp"
/>
<CheckBox
android:id="#+id/termsCheckbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/countryTextView" />
<TextView
android:id="#+id/termsTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/termsCheckbox"
android:layout_alignBottom="#+id/termsCheckbox"
android:text="I AGREE TO THE TERMS AND CONDITIONS STATED"
android:textColor="#android:color/darker_gray"
android:layout_alignBaseline="#+id/termsCheckbox"
/>
<Button
android:id="#+id/signupButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/termsTextView"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#drawable/signup"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
How to resolve this issue ?
EDIT:
I have attached a screenshot of my problem. I have entered "h" in the passwordEditText but nameEditText gets the value.
mTabHost.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
#Override
public void onViewDetachedFromWindow(View v) {}
#Override
public void onViewAttachedToWindow(View v) {
mTabHost.getViewTreeObserver().removeOnTouchModeChangeListener(mTabHost);
}
});
Add this code in MainActivity.Java #setTabs() function after
mTabHost.setup(this, getSupportFragmentManager(), android.R.id.tabcontent);
this line.
Best of luck.
You can set focus to desired edit text after you make the change: ex.
myEditText3.setFocusableInTouchMode(true);
myEditText3.requestFocus();
It's Working in my device.
I don't know why it's not working in yours, I think in java code, there may be some error.
But you can try,
<RelativeLayout
android:id="#+id/parentLayout"
android:layout_width="match_parent"
android:focusableInTouchMode="true"
android:layout_height="match_parent" >
add 3rd line to your "parentLayout"