Separator does not show in relative layout - android

I have a view as shown below. There is a separator (vertical divider) before imageview. I can see the separator on graphical layout, but when I run the code, separator is not shown on emulator and phone.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/product_list_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical"
android:padding="0sp" >
<RelativeLayout
android:id="#+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5sp" >
<TextView
android:id="#+id/product_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="#+id/product_price"
android:layout_toLeftOf="#+id/product_price"
android:text="product_name"
android:layout_centerVertical="true"
android:textColor="#2c3e50"
android:textSize="15sp"/>
<TextView
android:id="#+id/product_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toStartOf="#+id/seperator"
android:layout_toLeftOf="#+id/seperator"
android:text="525 manat"
android:layout_centerVertical="true"
android:textColor="#34495e"
android:textSize="15sp"
android:layout_marginEnd="10sp"
android:layout_marginLeft="10sp"
android:layout_marginRight="5sp"
android:layout_marginStart="5sp"/>
<View
android:id="#+id/seperator"
android:layout_width="2sp"
android:layout_height="match_parent"
android:layout_toStartOf="#+id/addCartBtn"
android:layout_toLeftOf="#+id/addCartBtn"
android:layout_alignParentTop="true"
android:layout_marginEnd="2sp"
android:layout_marginStart="2sp"
android:layout_marginLeft="2sp"
android:layout_marginRight="2sp"
android:background="#9a9d9f" />
<ImageView
android:id="#+id/addCartBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="3sp"
android:layout_marginRight="3sp"
android:background="#FFFFFF"
android:focusable="false"
android:focusableInTouchMode="false"
android:src="#drawable/addcart" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#767e84" />
</LinearLayout>

Related

Set one element above another and have width of both the element equal

I want to set the text field above the black image and i want the width of text field should be equal to image.
I dont want to put hardcoded dimensions. Also both the blocks should qually cover the screen horizontally.
Here is my code `
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/RL_childLeft1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<com.ism.eshita.incentivemanagmentsystem.Speedometer.Speedometer
android:id="#+id/Speedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#000000"
custom:currentSpeed="100"
custom:maxSpeed="300" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<TextView
android:id="#+id/tv_bg1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/PrimaryDark2"
android:gravity="center"
android:text="BG"
android:textColor="#color/white"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_performance1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/PrimaryDark2"
android:gravity="center"
android:paddingBottom="5dp"
android:text="Performance"
android:textColor="#color/white" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
>
<com.ism.eshita.incentivemanagmentsystem.Speedometer.Speedometer
android:id="#+id/Speedometer2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#000000"
custom:currentSpeed="100"
custom:maxSpeed="300" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<TextView
android:id="#+id/tv_bg2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/PrimaryDark2"
android:gravity="center"
android:text="BG"
android:textColor="#color/white"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_performance2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/PrimaryDark2"
android:gravity="center"
android:paddingBottom="5dp"
android:text="Performance"
android:textColor="#color/white" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

Fetch imageview to all the screen in relativelayout between buttons and edittext

I have the below XML relativelayout... I need help to make the image always fetch to all the screen but between above name ju and below buttons.
the following ImageView parameter make the image centered.
<?xml version="1.0" encoding="utf-8"?>
< RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:id="#+id/nameview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFFE0"
android:paddingBottom="10dp"
android:paddingTop="14dp"
android:paddingLeft="45dp"
android:fontFamily="Arial"
android:textSize="18sp"
android:textStyle="bold"
android:text="Ju" />
<ImageView android:id="#+id/SingleView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/nameview"/>
<Button
android:id="#+id/funnyBtn"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginTop="10dp"
android:layout_below="#+id/SingleView"
android:layout_alignParentLeft="true"
android:src="#drawable/smileclk"
android:background="#drawable/smileclk"
android:layout_marginLeft="25dp"
android:text="" />
<Button
android:id="#+id/test1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/SingleView"
android:layout_toRightOf="#+id/funnyBtn"
android:layout_marginLeft="15dp"
android:text="test1" />
<Button
android:id="#+id/test2Btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/SingleView"
android:layout_toRightOf="#+id/comment"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:text="test2" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="20dp"
android:layout_below="#+id/test2Btn"
android:background="#ff00ff00" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="20dp"
android:padding="10dip" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Calculation" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#ffffff" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
this is my result for now
this is my desire output
As murtaza mentioned adding android:scaleType="fitXY" helped
<ImageView android:id="#+id/SingleView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:layout_below="#id/nameview"/>

TextView is not updated within RelativeLayout

I'm developing a custom camera app. CameraPreview takes a part of the screen, and the rest of the screen on the rightis allocated for control panel.
Now, when I change the shooting parameters, the text view and toggle views on the control panels are not updated. I guess this is because of the camera, but I have no clue what to do.
This is a screen shot:
the screen shot with messed textview
My layout looks like this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="#+id/total_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<FrameLayout
android:id="#+id/gen_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#AA8888">
<FrameLayout
android:id="#+id/camera_preview"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</FrameLayout>
<RelativeLayout
android:id="#+id/overlay_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="#+id/topLeftMark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:src="#drawable/red_left_top_corner"
android:tag="mark" />
<ImageView
android:id="#+id/bottomLeftMark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:src="#drawable/red_left_bottom_corner"
android:tag="mark" />
<ImageView
android:id="#+id/topRightMark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:src="#drawable/red_right_top_corner"
android:tag="mark" />
<ImageView
android:id="#+id/bottomRightMark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:src="#drawable/red_right_bottom_corner"
android:tag="mark" />
<ImageView
android:id="#+id/leftCrop"
android:layout_width="1dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:scaleType="fitXY"
android:src="#drawable/rect_60_trasparent" />
<ImageView
android:id="#+id/rightCrop"
android:layout_width="1dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:scaleType="fitXY"
android:src="#drawable/rect_60_trasparent" />
<ImageView
android:id="#+id/upperCrop"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:scaleType="fitXY"
android:src="#drawable/rect_60_trasparent" />
<ImageView
android:id="#+id/bottomCrop"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:scaleType="fitXY"
android:src="#drawable/rect_60_trasparent" />
</RelativeLayout>
</FrameLayout> <!-- GEN_VIEW END -->
<RelativeLayout
android:id="#+id/whparent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true">
<include layout="#layout/wheel_panel"/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/adLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:gravity="bottom"
android:layout_toLeftOf="#id/whparent"
android:layout_alignTop="#id/whparent"
>
</RelativeLayout>
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignLeft="#id/whparent"
android:layout_margin="10dp"
android:text="#string/hello"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/control_panel"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:orientation="vertical" >
<TextView
android:id="#+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="Pocket Viewfinder" />
<TextView
android:id="#+id/viewAngle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/hello"
android:textSize="10sp" />
<TextView
android:id="#+id/widerWarning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/wWarning"
android:textColor="#color/warning_color"
android:textSize="10sp"
android:visibility="invisible" />
<Button
android:id="#+id/button_capture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/capture_button" />
<ToggleButton
android:id="#+id/booster_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:textOff="#string/booster_off"
android:textOn="#string/booster_on" />
</LinearLayout>
</RelativeLayout> <!-- TOTAL_VIEW END -->
</RelativeLayout>
Everytime the TextView text is changed, I call:
controlPanelView.requestLayout();
But the controlPanelView is not updated at all.
What am I doing wrong? THNX

ScrollView not works on Relative Layout

I am trying to make my layout Scrollable by adding ScrollView as an parent for my Relative Layout.But my layout not scrolled.I have added the fillport property to true.
Here is my xml file:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/repActivityTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:ellipsize="middle"
android:textSize="18sp"
android:background="#android:color/darker_gray"
android:text="#string/representativeTitle" />
<TextView
android:id="#+id/repStreet"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/repImage"
android:layout_marginTop="14sp"
android:layout_toRightOf="#+id/repImage"
android:layout_margin="3sp"
android:text="#string/repStreet" />
<TextView
android:id="#+id/repState"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/repStreet"
android:layout_toRightOf="#+id/repImage"
android:text="#string/repState" />
<TextView
android:id="#+id/repCountry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/repState"
android:layout_below="#+id/repState"
android:text="#string/repCountry" />
<com.google.android.maps.MapView
android:id="#+id/repMap"
android:layout_width="100dip"
android:layout_height="100dip"
android:paddingTop="2dp"
android:layout_marginTop="2dp"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/repImage"
android:apiKey="0lsQmtr2D241pSL53j0vQ2lYUs4_ZIWkIHyHAKw" >
</com.google.android.maps.MapView>
<View
android:id="#+id/firstHorizontalLine"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/repMap"
android:layout_marginTop="54dp"
android:background="#android:color/black" />
<TextView
android:id="#+id/issues2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/issues1"
android:layout_centerVertical="true"
android:text="#string/issues2" />
<View
android:id="#+id/secondHorizontalLine"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/accomplishments"
android:background="#android:color/black" />
<TextView
android:id="#+id/issues"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignBottom="#+id/firstHorizontalLine"
android:layout_alignRight="#+id/repStreet"
android:text="#string/issues" />
<TextView
android:id="#+id/accomplish2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/accomplish1"
android:layout_below="#+id/accomplish1"
android:layout_marginTop="18dp"
android:text="#string/accomplishments2" />
<TextView
android:id="#+id/promises"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/issues"
android:gravity="center"
android:layout_below="#+id/accomplish2"
android:text="#string/promises" />
<View
android:id="#+id/thirdHorizontalLine"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/black"
android:layout_alignParentLeft="true"
android:layout_below="#+id/promises" />
<TextView
android:id="#+id/accomplishments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/issues2"
android:gravity="center"
android:layout_toLeftOf="#+id/repMap"
android:text="#string/accomplishments" />
<TextView
android:id="#+id/accomplish1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/secondHorizontalLine"
android:layout_marginTop="21dp"
android:text="#string/accomplishments1" />
<TextView
android:id="#+id/issues1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/issues2"
android:layout_alignParentLeft="true"
android:layout_marginBottom="14dp"
android:text="#string/issues1" />
<ImageView
android:id="#+id/repImage"
android:layout_width="100dip"
android:layout_height="100dip"
android:layout_alignParentLeft="true"
android:layout_below="#+id/repActivityTitle"
android:contentDescription="#string/representativeImage"
android:paddingTop="2dp"
android:layout_marginTop="2dp"
android:scaleType="centerCrop"
android:src="#drawable/icon" />
<TextView
android:id="#+id/promise1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/thirdHorizontalLine"
android:layout_marginTop="19dp"
android:text="#string/promises1" />
<TextView
android:id="#+id/promise2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/promise1"
android:text="#string/promises2" />
</RelativeLayout>
</ScrollView>
Here I have used the ScrollView but the full content of layout is not as showing.As scrolls not work here.
Try to remove this line and check
android:fillViewport="true"
And also you can try height of relativelayout to match_parent instead of wrap_content
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>

Scroll view doesn't work in layout

I have a scroll view:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
>
<LinearLayout
android:layout_width="500dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#color/antiquewhiter"
android:weightSum="100"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:background="#drawable/green_gradient_top_bar"
>
<TextView
android:id="#+id/log_in_header_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="#string/Einloggen_text"
style="#style/headerfromdialogs" />
<ImageView
android:id="#+id/log_in_header_exit_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/log_in_header_text"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:onClick="finish"
android:src="#drawable/x_android" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="90" >
<TextView
android:id="#+id/log_in_benutzername_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="40dp"
android:layout_marginTop="80dp"
android:text="#string/Benutzername_text"
style="#style/dialogsGreenTexts" />
<EditText
android:id="#+id/log_in_benutzername_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/log_in_benutzername_text"
android:layout_alignBottom="#+id/log_in_benutzername_text"
android:layout_marginLeft="50dp"
android:layout_marginRight="20dp"
android:layout_toRightOf="#+id/log_in_benutzername_text"
android:ems="10"
android:hint="#string/hint_name_log_in"
>
</EditText>
<TextView
android:id="#+id/log_in_passwort_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/log_in_benutzername_text"
android:layout_below="#+id/log_in_benutzername_edit_text"
android:layout_marginTop="52dp"
android:text="#string/Passwort_text"
style="#style/dialogsGreenTexts" />
<EditText
android:id="#+id/log_in_passwort_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/log_in_passwort_text"
android:layout_alignBottom="#+id/log_in_passwort_text"
android:layout_alignLeft="#+id/log_in_benutzername_edit_text"
android:ems="10"
android:layout_marginRight="20dp"
android:inputType="textPassword"
android:hint="#string/hint_passwort_log_in"
>
</EditText>
<Button
android:id="#+id/log_in_button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignRight="#+id/log_in_passwort_edit_text"
android:layout_marginBottom="45dp"
android:layout_marginRight="-10dp"
android:onClick="logIn"
android:text="#string/Login_text"
style="#style/bold_text18" />
<!-- android:background="#drawable/green_gradient_button" -->
<TextView
android:id="#+id/log_in_passwort_vergessen_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/log_in_button"
android:layout_alignLeft="#+id/log_in_passwort_edit_text"
android:text="#string/Passwort_vergessen_text"
style="#style/dialogsGreenTexts" />
<ProgressBar
android:id="#+id/waitProgessBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone"
/>
<TextView
android:id="#+id/userError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/log_in_benutzername_edit_text"
android:layout_alignLeft="#+id/log_in_benutzername_edit_text"
android:layout_marginBottom="5dp"
android:visibility="gone"
android:textColor="#color/errorRed"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
I want to scroll because on my se xperia neo V in horizontal orientation I can't see all view. Second problem is when I change orientation all view is broke. How change this view to show properly in both orientations?
but scroll doesn't work. Anyone know Why?
Please note :
1) Scroll view must have a single child (i.e all views must be included within a single root layout inside scroll view)
2) ScrollView works when your page size is greater the default height of the screen .
Please check both these things and if still does not work ... Paste some code to have a better understanding of the problem.
try this code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#color/antiquewhiter"
android:weightSum="100"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:background="#drawable/green_gradient_top_bar"
>
<TextView
android:id="#+id/log_in_header_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="#string/Einloggen_text"
style="#style/headerfromdialogs" />
<ImageView
android:id="#+id/log_in_header_exit_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/log_in_header_text"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:onClick="finish"
android:src="#drawable/x_android" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="90" >
<TextView
android:id="#+id/log_in_benutzername_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="40dp"
android:layout_marginTop="80dp"
android:text="#string/Benutzername_text"
style="#style/dialogsGreenTexts" />
<EditText
android:id="#+id/log_in_benutzername_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/log_in_benutzername_text"
android:layout_alignBottom="#+id/log_in_benutzername_text"
android:layout_marginLeft="50dp"
android:layout_marginRight="20dp"
android:layout_toRightOf="#+id/log_in_benutzername_text"
android:ems="10"
android:hint="#string/hint_name_log_in"
>
</EditText>
<TextView
android:id="#+id/log_in_passwort_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/log_in_benutzername_text"
android:layout_below="#+id/log_in_benutzername_edit_text"
android:layout_marginTop="52dp"
android:text="#string/Passwort_text"
style="#style/dialogsGreenTexts" />
<EditText
android:id="#+id/log_in_passwort_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/log_in_passwort_text"
android:layout_alignBottom="#+id/log_in_passwort_text"
android:layout_alignLeft="#+id/log_in_benutzername_edit_text"
android:ems="10"
android:layout_marginRight="20dp"
android:inputType="textPassword"
android:hint="#string/hint_passwort_log_in"
>
</EditText>
<Button
android:id="#+id/log_in_button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignRight="#+id/log_in_passwort_edit_text"
android:layout_marginBottom="45dp"
android:layout_marginRight="-10dp"
android:onClick="logIn"
android:text="#string/Login_text"
style="#style/bold_text18" />
<!-- android:background="#drawable/green_gradient_button" -->
<TextView
android:id="#+id/log_in_passwort_vergessen_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/log_in_button"
android:layout_alignLeft="#+id/log_in_passwort_edit_text"
android:text="#string/Passwort_vergessen_text"
style="#style/dialogsGreenTexts" />
<ProgressBar
android:id="#+id/waitProgessBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone"
/>
<TextView
android:id="#+id/userError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/log_in_benutzername_edit_text"
android:layout_alignLeft="#+id/log_in_benutzername_edit_text"
android:layout_marginBottom="5dp"
android:visibility="gone"
android:textColor="#color/errorRed"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

Categories

Resources