2

appWidget の layout_weight と remoteView に問題があります。

私のトグルはすべてこのようなものです 私のトグル

このxmlで:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/appwidget_button_center"
android:gravity="bottom"
android:orientation="vertical"
android:visibility="visible" >

    <ImageView
            android:id="@+id/toggle_img"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="2"
            android:scaleType="center" />
    
         <TextView
            android:id="@+id/toggle_txt"
            style="@style/TextSmallButton" 
            android:layout_height="0dip"
            android:layout_weight="1"
            />
        <ImageView
            android:id="@+id/toggle_ind"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitXY"
            android:src="@drawable/b7_on" />
    </LinearLayout>

ここで、トグルの 1 つをデフォルト サイズよりも 2 倍のサイズにしたいので、特定のトグルに対してのみ xml に layout_weight = 2 を設定します。そして今、私はこれを持っています: 今

私の活動でこれを行うと、それは私が持っている仕事です: 私が欲しいもの

では、どうすればこれを解決できますか...

4

0 に答える 0