I have one spinner in which I have set the value through an Adapter. The problem is that when the spinner is closed at that time it shows the text as perfectly readable with proper size. But when we click on spinner and show the text, that text shows me as not readable that means with cut text.
This problem is only occurring on Galaxy Tab and Galaxy s3. Means with screen size high. So please can anybody help me to solve this problem?
The screen shot of spinner is
and I want actually this
The Spinner code in xml is
<Spinner
android:id="@+id/ddCountry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
I have set the one style to set the textcolor to black, and the code is like this
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.NoTitleBar.WithColoredSpinners" parent="@android:style/Theme.NoTitleBar">
<item name="android:spinnerItemStyle">@style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">@style/SpinnerItem.DropDownItem</item>
</style>
<style name="SpinnerItem" parent="@android:style/Widget.TextView.SpinnerItem">
<item name="android:textColor">#000000</item>
</style>
<style name="SpinnerItem.DropDownItem" parent="@android:style/Widget.DropDownItem.Spinner">
<item name="android:textColor">#000000</item>
</style>
</resources>
The code for fillup the value in spinner is like this:
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(
Registration.this, android.R.layout.simple_spinner_item, list);
dataAdapter
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner1.setAdapter(dataAdapter);
This code is working in most of devices, but the problem comes when screen size is high like Galaxy Tab.
I got the solution.Its my mistake that i had set the
android:anyDensity="false".So it was not working in Galaxy tab.