0
I am working on a small project for the college and came across this when using a Toast:
I have no idea what made Toast look like this. Has anyone experienced a similar problem?
Edition: This is the code I’m using to create Toast:
Toast.makeText(Singleton.getInstance().getContext(), "Nota criada com sucesso!", Toast.LENGTH_SHORT).show();
I noticed that the error appeared after I installed the Systembartint library. Before using it, I had tried to get the same result using only XML aquives, but I was not satisfied. Can anything in it be influencing? This is mine styles.xml
current:
<resources>
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/Notas.ActionBar</item>
<item name="android:actionBarWidgetTheme">@style/Notas.ActionBar.OverflowMenu</item>
<item name="android:fitsSystemWindows">true</item>
<item name="android:clipToPadding">true</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
<style name="Notas.ActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@color/roxo</item>
<item name="android:titleTextStyle">@style/Notas.ActionBar.TitleTextStyle</item>
</style>
<style name="Notas.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@color/branco</item>
</style>
<style name="Notas.ActionBar.OverflowMenu" parent="android:Theme.Holo.Light">
<item name="android:popupMenuStyle">@android:style/Widget.Holo.Light.PopupMenu</item>
<item name="android:dropDownListViewStyle">
@android:style/Widget.Holo.Light.ListView.DropDown
</item>
</style>
</resources>
Could you include the code? Is it not a line break that forces the text to have two lines? Could you test a
trim
inString
?– Wakim
@Wakim, I edited my question. I’m going to test Trim now. EDIT: the
trim
did not solve the problem.– Renan Lazarotto
Looking at the code there is no error. The
trim
will not help. Must be some style that is influencing in Toast, have to check thestyle
of it. I do not recommend putting thefitSystemWindows
and theclipToPadding
in theAppTheme
, can interfere in a lot of things. I usually put in eachView
layout root, but it can be laborious. Try doing the following: remove these two attributes to see if they are causing trouble inToast
.– Wakim