You can install the theme through Android Manifest xml or inside Activity onCreate using setTheme(android.R.style.Theme_Holo);
The size of the buttons is not related to the theme itself. Size depends on your xml definitions. In the image you posted, the buttons seem to have got the Holo theme, so thereβs nothing wrong ...
Here's an xml layout that stretches the buttons to fill the entire width of the dialog box:
<?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="wrap_content" > <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LinearLayout> </LinearLayout>
Lior Iluz Mar 21 2018-12-12T00: 00Z
source share