私はアプリ ウィジェットを作成しています。レイアウトはView
ウィジェットの下部に を配置し、 と を保持し、TextView
そのImageView
上View
に を配置してメイン テキストを保持します。私が持っている問題は、「上部」View
が下部と重なっているように見えることですView
:
アップデート
今、私は「トップ」ビューがボトムビューと重なっていないと考えていますが、何かが画像の上部を切り取っています。別のスクリーンショットを次に示します。
ご覧のとおり、テキストは下部ビューの上部で切り取られていますが、画像も切り取られています。以下は、画像が 18 dp にスケーリングされていないスクリーンショットです。
私は非常に混乱しています。
これは私が使用しているコードです:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widgetLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="@dimen/widget_margin">
<RelativeLayout
android:id="@+id/widgetBgLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:background="@drawable/bg_widget"
>
<RelativeLayout
android:id="@+id/widgetStatusLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:paddingTop="10dp"
>
<TextView
android:id="@+id/widgetStatus"
style="@style/WidgetStatus"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
/>
<ImageView
android:id="@+id/widgetIcon"
android:src="@drawable/icon"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="centerInside"
android:adjustViewBounds="true"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_above="@id/widgetStatusLayout"
android:layout_alignParentTop="true"
>
<TextView
android:id="@+id/widgetTitle"
style="@style/WidgetTitle"
/>
<TextView
android:id="@+id/widgetText"
style="@style/WidgetText"
/>
</LinearLayout>
</RelativeLayout>
</FrameLayout>