Ich möchte background color #df0031
zu meinem RelativeLayout borders
anzeigen, so dass mein ganzes Android screen
background #df0031
einschließlich Grenzen haben wird, die gerade weiße Farbe haben.Wie füge ich RelativeLayout-Rahmen Hintergrundfarbe hinzu?
Bitte obigen Screenshot sehen und mir helfen, meine XML
so zu aktualisieren, so dass die Grenzen des Android Screen
die background color #df0031
Anpassung mit dem Rest des Bildschirms statt #ffffff haben.
Layout (XML):
<FrameLayout 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"
tools:context="in.sitemakers.sitemakers.HomeFragment"
android:background="@color/colorBgHome"
>
<TextView
android:id="@+id/home_heading"
android:layout_marginTop="10dp"
android:text="WE CREATE AWESOME WEB SITES"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorTextHome"
/>
<TextView
android:layout_below="@+id/home_heading"
android:id="@+id/home_text"
android:layout_marginTop="28dp"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorTextHome"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/main_device_image"
android:textColor="@color/colorTextHome"
/>
</FrameLayout>
Colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorBgHome">#df0031</color>
<color name="colorTextHome">#ffffff</color>
</resources>
content_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="in.sitemakers.sitemakers.MainActivity"
tools:showIn="@layout/app_bar_main">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
Vielen Dank für Ihre Zeit.
Hat das Layout, in dem diese Datei enthalten ist (HomeFragment), einen Rand um sie herum? –
Bearbeiten Sie Ihre Frage fügen Sie etwas Code aus dem Layout der Aktivität, wo Sie das Fragment tatsächlich setzen – Xenolion
Der Container des Fragments zeigen es – Xenolion