0

TextView基本的な灰色/黒のホロ背景を aおよび aに追加するにはどうすればよいですかSeekBar。どちらも、 に含まれるカメラ プレビューにオーバーレイされFrameLayoutます。現在、背景が欠落しているため、どちらもほとんど見えません。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <FrameLayout
        android:id="@+id/scanner_camera_preview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <TextView
        android:id="@+id/scanner_help_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="Den Zoom-Regler benutzen um den Barcode auszuwählen." />

    <SeekBar
        android:id="@+id/scanner_camera_seek"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/scanner_help_text" />

</RelativeLayout>
4

2 に答える 2

1

XML レイアウトをこれに変更します。テキスト ビューに紫、シークバーに赤を追加しました。必要に応じて変更

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" >

    <FrameLayout
            android:id="@+id/scanner_camera_preview"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    <TextView
            android:id="@+id/scanner_help_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:background="@android:color/holo_purple"
            android:text="Den Zoom-Regler benutzen um den Barcode auszuwählen." />

    <SeekBar
            android:id="@+id/scanner_camera_seek"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_above="@id/scanner_help_text"
            android:background="@android:color/holo_red_light"/>

</RelativeLayout>
于 2013-10-21T11:04:34.743 に答える
-1
android:background="@drawable/yourdrawable"
于 2013-10-21T11:02:31.660 に答える