问题
I have the following problem displaying a Spinner
inside a DialogFragment
.
The Spinner
is displayed cut and it's only displayed OK when the keyboard appears.
The Spinner
is actually a custom class with the following code:
import android.content.Context;
import android.util.AttributeSet;
import com.actionbarsherlock.internal.widget.IcsSpinner;
public class CustomIcsSpinner extends IcsSpinner {
public CustomIcsSpinner(Context context, AttributeSet attrs) {
super(context, attrs, com.actionbarsherlock.R.attr.actionDropDownStyle);
}
public CustomIcsSpinner(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
}
How can I fix this?
Thanks in advance.
回答1:
Go to com.actionbarsherlock.internal.widget.IcsSpinner
source code.
Find DropdownPopup popup = new DropdownPopup(context, attrs, defStyle);
Replace with DropdownPopup popup = new DropdownPopup(context.getApplicationContext(), attrs, defStyle);
Works for me;
:)
来源:https://stackoverflow.com/questions/15850337/spinner-options-an-icsspinner-from-abs-inside-dialogfragment-are-displayed-tru