Фон для Android Layout
Как добавить основной серый / черный голографический фон в TextView
и 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>
2 ответа
Решение
Измените свой 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>