tags:

views:

26

answers:

1

Hello,

I have a problem with designing an UI Android activity. There are two blocks of misplaced graphics on the left and right of the activity - they are two lines just bellow the titlebar with 1px height and about 5-10px width. They cause buttons to break at their left and right parts. I cannot figure out what the problem is. I am using Eclipse with Android SDK 0.9.9. The lines appear not only with the emulator but in a HTC Wildfire (Android 2.1). These lines are also visible in a newly created Android project (HelloWorld).

Sorry, but I was not allowed to post images, being too new here :)

Link to the Broken widgets - note the button's left and right sides

XML layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_height="fill_parent" android:layout_width="fill_parent" android:fitsSystemWindows="true">
<TextView android:layout_height="wrap_content" android:text="This text view should act as header  " android:id="@+id/expenseHeaderTxt" android:layout_width="fill_parent" android:paddingLeft="5px" android:paddingRight="5px"/>
<ScrollView android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_marginBottom="50dip" android:id="@+id/expenseScrollView">
  <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scrollbars="none" android:paddingLeft="5px" android:paddingRight="5px">
    <EditText android:layout_height="wrap_content" android:id="@+id/expenseAmountEdit" android:hint="@string/ExpenseAmountHint" android:layout_width="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:selectAllOnFocus="true" android:digits="0123456789" android:inputType="number|numberDecimal" android:maxLines="1"></EditText>
    <EditText android:layout_height="wrap_content" android:id="@+id/expenseTypeEdit" android:layout_width="fill_parent" android:layout_toLeftOf="@+id/expenseAmountEdit" android:hint="@string/ExpenseSpendTypeHint" android:inputType="text|textCapSentences" android:maxLines="1"></EditText>
    <ToggleButton android:layout_below="@id/expenseTypeEdit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/expenseTypeSignToggle" android:textOn="@string/ExpenseTypeSignPlusToggle" android:textOff="@string/ExpenseTypeSignMinusToggle"></ToggleButton>
<EditText android:layout_below="@id/expenseTypeSignToggle" android:layout_height="wrap_content" android:id="@+id/expenseNoteEdit" android:layout_width="fill_parent" android:hint="@string/ExpenseNoteHint"></EditText>
</RelativeLayout>
</ScrollView>
<RelativeLayout android:layout_marginTop="-50dip" android:gravity="bottom" android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingLeft="5px" android:paddingRight="5px">
  <Button android:id="@+id/expenseAddBtn" android:layout_width="fill_parent" android:text="A button that should always be at the bottom" android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>
A: 

Funny, I also had the ListView dividers disappearing when scrolling and during the hunt I found the code here:

http://stackoverflow.com/questions/3790308/disappearing-dividers-in-spinner-drop-down-list/3863485

It not only fixed the issue with the disappearing separators but also fixed the broken layout.

Kamen