私は、1つの奇妙な機能を備えたn個のアプリウィジェットを持っています。私はウィジェットでLinearLayoutを取得しました。データの行を追加することはできます。線形レイアウトの大きさと、与えられた行が収まるかどうかを知るための明白な方法はないように思われるので、データセット全体を追加するだけです(それほど大きくないので)。私のレイアウトのテキストが一番下に切り取られます。これは私が期待しているものです。しかし、その横にあるImageViewは切り取られず、代わりにスケーリングされます。それは、率直に言って、うんざりです。RemoteViewsのLinearLayoutがImageViewを切り取らない
行がLinearLayoutに収まるかどうかを知る方法があれば、それは素晴らしいことです。私のイメージを切り抜くためにそれを伝える方法があれば、それも良いでしょう。これが切り抜きのようなものです。
私は(ここでへまがありますならば、それは私が適用される匿名化からおそらくです)追加している行のレイアウト:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/checkbox"
android:layout_width="28sp"
android:layout_height="28sp"
android:src="@drawable/check_off"
android:layout_marginLeft="5dp"
android:layout_marginTop="1dp"
android:layout_alignParentLeft="true"/>
<TextView
android:id="@+id/textview"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16sp"
android:minHeight="28sp"
android:paddingLeft="5dp"
android:layout_centerVertical="true"
android:layout_alignWithParentIfMissing="true"
android:layout_toRightOf="@id/checkbox"/>
</RelativeLayout>
EDIT:行のコンテナは単純なのLinearLayoutです:
あなたのImageViewのにscaletypeを追加<LinearLayout
android:id="@+id/list_items"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_above="@id/logo"
android:layout_marginBottom="4dp"
android:padding="1dp"
android:orientation="vertical"
android:background="@drawable/widget_background"/>
あなたがurのメインレイアウト情報を追加した方が良いかもしれません。ここでは –
を追加していますが、ここではLinearLayoutを追加しましたが、かなり退屈です。 – jjb