This issue is testing my patience, I am designing a layout, this is where I have reached so far. Check below image
The part above "Save" button shows a complete black background, the one with currency and EditText.
What I was actually trying to do was remove the underline for the two EditText below the currency code. I was following different advice on this thread hence I made my linearLayout background set to #80000000
. But the underline was still there below the EditBox and it spoiled my linearlayout.
Hence, I decided to remove it and try something else. When I removed that line of code from everywhere and run the program. I still get that black background in my app.
Here is the xml code for my linearLayout
<LinearLayout
android:id="@+id/layout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="2"
android:paddingTop="10dp"
android:layout_marginBottom="30dp"
android:background="@drawable/custom_border"
>
<!--This layout is for typing currency values-->
<!--Creating two more sub linearLayout, to seperate two sections of
lef currency and right currency
android:background="@drawable/border_inner_linear"
-->
<LinearLayout
android:id="@+id/leftCurrencySection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="GBP"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0.00"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/rightCurrencySection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="USD"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="0.00"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
/>
</LinearLayout>
</LinearLayout>
As one can see, I don't have anything that shall show a black color in my LinearLayout with id layout1
Here is the ugly screen layout I am getting
It might be foolish of me to ask but does my app would be storing some sort of cache, because of which its showing same old layout?
Thanks in advance
EDIT
Here is the full code of the layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:background="@drawable/layer_list"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main"
tools:context=".MainActivity"
android:orientation="vertical"
android:weightSum="5"
>
<LinearLayout
android:id="@+id/layout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="2"
android:paddingTop="10dp"
android:layout_marginBottom="30dp"
android:background="@drawable/custom_border"
>
<!--This layout is for typing currency values-->
<!--Creating two more sub linearLayout, to seperate two sections of
lef currency and right currency
android:background="@drawable/border_inner_linear"
-->
<LinearLayout
android:id="@+id/leftCurrencySection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="GBP"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0.00"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
android:background="@null"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/rightCurrencySection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="USD"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="0.00"
android:textSize="30dp"
android:textColor="#ffffff"
android:textAllCaps="true"
android:textStyle="bold"
android:background="@null"
/>
</LinearLayout>
</LinearLayout>
<!--End of This layout is for typing currency values-->
<LinearLayout
android:id="@+id/buttonSection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<!--This layout is for save and change currency buttons-->
<Button
android:id="@+id/saveButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Save"/>
<Button
android:id="@+id/currencyButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Save"/>
</LinearLayout>
<!--End of save and change currency buttons-->
<!--Begin Layout for calculator begin-->
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:columnCount="3"
android:layout_gravity="center"
android:orientation="horizontal"
android:layout_weight="1"
>
<Button android:text="1"
android:background="@null"
/>
<Button android:text="2" />
<Button android:text="3" />
<Button android:text="4" />
<Button android:text="5" />
<Button android:text="6" />
<Button android:text="7" />
<Button android:text="8" />
<Button android:text="9" />
<Button android:text="." />
<Button android:text="0" />
<Button android:text="Del" />
</GridLayout>
<!--End Layout for calculator-->
<!--End Layout for calculator End-->
</LinearLayout>
EDIT: Code for custom xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:left="-10dp" android:right="-10dp" android:top="0dp"
android:bottom="0dp">
<shape android:shape="rectangle">
<stroke android:width="3dp" android:color="#faf8f8" />
</shape>
</item>
</layer-list>