按钮颜色不显示在真实设备/图像上,不填充背景

时间:2016-02-12 10:31:25

标签: android android-layout android-activity android-studio imageview

我正在创建一个Android应用程序,我使用backgroundTint#fed136创建了按钮,但问题是他们在我的真实设备上没有这种颜色。然而,有了背景,我相信他们这样做,但是按钮没有那些圆角。另外,我想要一个特定的图像将我的整个屏幕填满我的按钮,但它有点卡住,左边和右边的边缘都没有填充,手机的按钮也没有。此外,它也没有在我的屏幕上显示。

enter image description here

以上是应该如何,下面的是它是怎么回事......我的意思是这是怎么发生的?

<?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>

1 个答案:

答案 0 :(得分:1)

使用

  

机器人:背景= “#fed136”