2011-12-06 10 views
1

サウンドトラックを再生する音楽アプリケーション用のウィジェットを開発しています。私は、再生/一時停止、次、および前のボタンを持つ単純なウィジェットレイアウトを作成しようとしています。私はここに私のwidget_info.xmlを露出させています:Android Widgetのリモートビューが適切に膨張していません

<?xml version="1.0" encoding="utf-8"?> 
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" > 
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" 
    android:minWidth="800dip" 
    android:initialLayout="@layout/widget_layout" 
    android:minHeight="100dip" 
    android:updatePeriodMillis="180000"/> 
</appwidget-provider> 

私は、ウィジェットのサイズを変更しようとしました。私は250,320,400、そして800を試しましたが、私の最後の試みでしたが、まだウィジェットのサイズは同じ小さなデフォルトの種類です。

<?xml version="1.0" encoding="utf-8"?> 

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" android:layout_height="fill_parent" 
android:layout_marginLeft="2dip" android:layout_marginRight="4dip" 
android:background="@drawable/widget_bg"> 

    <LinearLayout android:id="@+id/player_controls_layout"  android:orientation="horizontal" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal" android:layout_marginTop="10dip"> 


     <ImageButton android:id="@+id/widget_prev" 
      android:layout_height="wrap_content" android:layout_width="50dip" 
      android:paddingLeft="15dip" android:src="@drawable/prev" 
      android:layout_gravity="center_vertical|center" android:clickable="true" /> 

     <ImageButton android:id="@+id/widget_play" 
      android:layout_height="wrap_content" android:layout_width="wrap_content" 
      android:src="@drawable/play" android:clickable="true" 
      android:focusable="true" /> 

     <ImageButton android:id="@+id/widget_next" 
      android:layout_height="wrap_content" android:layout_width="50dip" 
      android:paddingRight="15dip" android:src="@drawable/next" 
      android:layout_gravity="center_vertical|center" android:clickable="true" /> 
    </LinearLayout> 

</LinearLayout> 

オクラホマので、私は、レイアウトを膨らませるとき、私はすべての3つのボタンを見ることができない今、それについてのすべてのことを知っている:ここで

はwidget_layoutを行きます。私は再生ボタンの前半と半分だけを見ることができます、次のボタンはその再生ボタンの下にあります!今、私はどのように適切なウィジェットのレイアウトを作るのですか?私はまた、このxmlをうまく動作し、希望のレイアウトを示しているアクティビティに挿入しようとしました。

答えて

0

あなたは

android:minWidth="800dip" // change here 

    android:initialLayout="@layout/widget_layout" 

    android:minHeight="100dip" change here 
+0

以下のとおりappwidgetプロバイダファイルにウィジェットの高さと幅を変更する必要がrplyingが、私はすでに述べてきたためおかげで、私はそれらを変更しようとしましたが、それは動作していません! –

関連する問題