问题描述
我在 DialogFragment
中显示 Spinner
时出现以下问题。
Spinner
被显示,当键盘出现时它只显示OK。
Spinner
实际上是一个带有以下代码的自定义类:
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);
}
}
我该如何解决? / p>
提前感谢。
转到 com.actionbarsherlock.internal.widget.IcsSpinner
源代码
查找 DropdownPopup popup = new DropdownPopup(context,attrs,defStyle);
替换为 DropdownPopup popup = new DropdownPopup(context.getApplicationContext(),attrs,defStyle);
适用于我;
:)
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.
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;
:)
这篇关于DialogFragment中的Spinner选项(ABS的IcsSpinner)显示为截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!