Следующий диалог не зависит от весовых параметров. Может кто-нибудь объяснить, почему?
расширяемый язык разметки:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:weightSum="1" android:orientation="horizontal">
<TextView android:id="@+id/dialogtext" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_weight=".3" />
<Button android:id="@+id/dialogbutton"
android:layout_width="0dp" android:layout_weight=".7"
android:layout_height="wrap_content" android:text="Cancel" />
</LinearLayout>
Java:
dialog = new Dialog(GameActivity.this);
dialog.setContentView(R.layout.dialog);
TextView textdialog = (TextView) dialog.findViewById(R.id.dialogtext);
textdialog.setText("i dont care what size you want me to be, im comfortable with my body");
button = (Button) dialog.findViewById(R.id.dialogbutton);
button.setOnClickListener(this);
dialog.show();
Если я указываю размеры для dp, он отвечает, однако.