1
동일한 레이아웃을 여러 가지 형식으로 사용하고 싶습니다. 따라서 크기를 변경해야합니다.appwidget에서 레이아웃 객체의 너비를 변경하는 방법은 무엇입니까?
idpicframe을 사용하여 RelativeLayout의 너비를 프로그래밍 방식으로 어떻게 변경할 수 있습니까?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:gravity="left"
android:layout_centerVertical="true">
<RelativeLayout
android:id="@+id/picframe"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp" >
<ImageView
android:id="@+id/picture"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitCenter"
android:layout_centerInParent="true"
android:adjustViewBounds="true"
android:contentDescription="@string/app_name" />
<ImageView
android:id="@+id/overlay"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitCenter"
android:layout_centerInParent="true"
android:adjustViewBounds="true"
android:contentDescription="@string/app_name" />
...
내가 성공하지
remoteView.setString(R.id.picframe, "setWidth", "50dp");
및
remoteView.setString(R.id.picframe, "setLayoutWidth", "50dp");
을 시도했습니다.
'병합'태그에 대한 힌트를 주셔서 감사합니다. 그러나이 경우에는 레이아웃이이 스 니펫에서 볼 수있는 것보다 더 복잡하기 때문에 필요합니다. – Wookiee