2011-02-09 4 views
0

enter image description hereAndroidの2Dレイアウトエンジンのバグ?

あなたは全く新しい活動に一つだけのボタンを追加した場合、画面は次のようになります。

enter image description here

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 



<Button android:id="@+id/Button01" 
     android:layout_height="wrap_content" 
     android:text="false" 
     android:layout_width="wrap_content" ></Button> 


</LinearLayout> 

しかし、あなたはリストビューを追加した場合、その後、すべてがOKです。

enter image description here

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 

<ListView android:layout_width="fill_parent" 
      android:id="@+id/contactList" 
      android:layout_height="wrap_content" 
      android:layout_weight="1"/> 

<Button android:id="@+id/Button01" 
     android:layout_height="wrap_content" 
     android:text="false" 
     android:layout_width="wrap_content" ></Button> 


</LinearLayout> 

編集:これはQVGAモードでのみ発生しました。 HVGAモードは正常に動作しました。

+0

これはエミュレータまたは実際のデバイスで実行していますか? –

+0

どちらも同じ結果です。 – lovespring

+0

質問がありますか?またはバグを報告していますか?これはバグを報告する場所ではありません。 –

答えて

0

問題の内容がわかりません。これは完璧な意味合いがあります。最初のレイアウトでは線形レイアウトでfill_parentを使用し、ボタンではwrap_contentを使用しました。

ボタンはまさにそれが想定していたものでした。 wrap_contentで指定されたテキストの幅と高さを使って幅と高さを設定します。

ボタンが画面全体を埋めると予想される場合は、実際のビューでfill_parentを使用する必要があります。

編集:あなたのコードは、HVGA、QVGA、およびWVGAで完璧に機能します。

enter image description here

+0

あなたは、最初の画像で、ボタンが醜く見えるのですか – lovespring

+0

どのバージョンのソフトウェアですか? – user432209

+0

はQVGAでしか起こりませんが、これは本当にバグです! – lovespring