0

I am creating an Android application and I created buttons with the backgroundTint #fed136 but the problem is that they don't have that color on my real device. However, with background, I believe they do, but then the buttons don't have those round corners. Also, I want a certain image to fill my entire screen below my buttons, but it's kind of stuck, the edges on the left and right aren't filled, neither does the buttom of the phone. Plus that it's not showing on my screen either.

enter image description here

The one above is how it should be, the one below is how it is.. I mean how does this happen?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
android:clickable="false"
android:background="#222">

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="About"
    android:id="@+id/button"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:backgroundTint="#fed136" />

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Portfolio"
    android:id="@+id/button3"
    android:layout_alignBottom="@+id/button"
    android:layout_centerHorizontal="true"
    android:backgroundTint="#fed136" />

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Contact"
    android:id="@+id/button4"
    android:layout_alignBottom="@+id/button3"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:backgroundTint="#fed136" />

 <ImageView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/imageView"
    android:layout_below="@+id/button3"
    android:scaleType="fitXY"
    android:src="@drawable/header" />

   </RelativeLayout>
lucafj2j282j
  • 879
  • 3
  • 13
  • 32
  • 1
    Could you provide your layout file? – Marius Kaunietis Feb 12 '16 at 10:32
  • @MariusKaunietis it's added! – lucafj2j282j Feb 12 '16 at 10:42
  • Remove padding of the RelativeLayout to make your image cover the whole layout. Also change scaleType to fitXY. For the other issue, you should use background property to give it color, not backgroundtint. I dont understand the issue with rounded corners, you are not using a custom style or anything as your background, so how does that change? – Onur Çevik Feb 12 '16 at 10:47
  • you should make a drawable for rounded corners and set it as background of your buttons, and I tried your code it is coming as your expectation only buttons are not rounded for that you have to make a drawable – Surabhi Singh Feb 12 '16 at 10:51
  • Have a look at http://stackoverflow.com/questions/27735890/lollipops-backgroundtint-has-no-effect-on-a-button It might be the reason of your problem – Vasily Kabunov Feb 12 '16 at 10:53
  • Use textView instead of Buttons, and give it background, padding etc. as per your requirement. It will looks good. – Bhoomika Feb 12 '16 at 11:03

1 Answers1

1

use

android:background="#fed136"

Nuke
  • 406
  • 3
  • 13