Wednesday, 15 September 2010

android - Same xml but different dialog result in Gingerbrad and ICS -



android - Same xml but different dialog result in Gingerbrad and ICS -

this question: have xml file describes layout custom dialog in app. running on 2 avd gingerbread 2.3.3 , ics 4.0.3 dialog seems appear "normal" on gb , "too small" on ics.!! cant understand why happening. link image xml code is: `

<textview android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center" android:text="aggiungi una nuova spesa!" android:paddingbottom="5dip" android:textstyle="bold" /> <imageview android:src="@android:drawable/divider_horizontal_dim_dark" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingbottom="10dip"/> <edittext android:id="@+id/edittoggetto" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="inserisci l'oggetto..." android:paddingtop="5dip"/> <edittext android:id="@+id/edittprezzo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputtype="numberdecimal" android:hint="inserisci il prezzo..."/> <linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:id="@+id/textvselezionacategoria" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="16dip" android:paddingleft="5dip" android:paddingbottom="4.0dip" android:textstyle="bold" android:text="categoria"/> <spinner android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/spinner_categoria"/> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:id="@+id/textvfontepagamento" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="16dip" android:paddingleft="5dip" android:paddingbottom="4.0dip" android:textstyle="bold" android:text="pagamento "/> <spinner android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/spinner_aggsp"/> </linearlayout> </linearlayout> <textview android:id="@+id/textvdataoraaggiungispesa" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="20dip" android:paddingleft="5dip" android:paddingbottom="4dip" android:textstyle="bold" android:text="data: "/> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingleft="5dip" android:paddingbottom="10dip"> <button android:id="@+id/calendariosmall" android:layout_width="20dip" android:layout_height="20dip" android:background="@drawable/calendario_small" android:clickable="false"/> <textview android:id="@+id/textvcambiadata" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="15dip" android:textstyle="bold" android:text="modifica\n data" android:layout_marginleft="2dip"/> <button android:id="@+id/timesmall" android:layout_width="20dip" android:layout_height="20dip" android:background="@drawable/time_small" android:clickable="false" android:layout_marginleft="10dip"/> <textview android:id="@+id/textvcambiaora" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="15dip" android:textstyle="bold" android:layout_marginleft="2dip" android:text="modifica\n ora"/> </linearlayout> <linearlayout android:orientation="vertical" android:background="@android:drawable/bottom_bar" android:padding="5dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightsum="1"> <button android:id="@+id/btnaggiungioggetto" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="aggiungi" android:layout_weight="0.5"/> <button android:id="@+id/btnannullaoggetto" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="annulla" android:layout_weight="0.5"/> </linearlayout>

`

in activity phone call dialog in way:

final dialog dialog = new dialog(this); dialog.requestwindowfeature(window.feature_no_title); dialog.setcontentview(r.layout.dialogaggiungispesa); ... dialog.show();

how can resolve problem? have same dialog layout on every version of android. answers!

android android-layout android-dialog

No comments:

Post a Comment