-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlertDialog buttons doesn't fit in dialog box on Android 5.0 #40
Comments
Oh, thanks...I will investigate about it but ofcourse your pull request is welcome!:) |
Any fix for this issue? |
<resources>
<style name="AppBaseTheme" parent="android:Theme.Material.Light">
<!-- AlertDialog Style override in order to try to fix non line breaking buttons -->
<item name="android:alertDialogTheme">@style/CustomAlertDialogStyle</item>
</style>
<style name="CustomAlertDialogStyle" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:buttonBarButtonStyle">@style/CustomButtonBarButtonStyle</item>
<item name="android:buttonBarStyle">@style/CustomButtonBarStyle</item>
</style>
<style name="CustomButtonBarStyle" parent="@android:style/Widget.Material.Light.ButtonBar.AlertDialog">
<!-- Making sure, the button bar uses parent width and is not restricted in height -->
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:height">@null</item>
<item name="android:minHeight">@null</item>
</style>
<style name="CustomButtonBarButtonStyle" parent="@android:style/Widget.Material.Light.Button.Borderless.Colored">
<!-- Setting the weight as follows should result in equally wide buttons filling the alert dialog width,
but instead they span further out of the dialog, breaking in multiple lines though -->
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
<!-- setting a fixed width as follows results in narrow buttons with line breaks, but of course this is not a solution -->
<!-- <item name="android:width">100dp</item> -->
</style>
</resources> |
Why I was tagged ? |
@maarekj Sorry, my mistake... |
Thank you @hotchemi . |
Coil, thanks! Sent from a mobile phone, please excuse any auto correct nonsense
|
Any traction on this, it's not working currently (49) |
@voidstarfire it's working on https://github.com/Vorlonsoft/AndroidRate |
I've noticed that on Android 5.0 buttons in AlertDialog doesn't fit in dialog box. Similar problem described here: http://stackoverflow.com/questions/26708976/alert-dialog-buttons-problems-in-android-l
Unfortunately I don't have solution for this except of using custom layout for AlertDialog.
Here is few examples how does the problem looks like:
The text was updated successfully, but these errors were encountered: