如何更改Android中EditTextPreference的dialogMessage字体?
我想要更改默认对话框的字体风格,但我不知道该怎么做!
这是我的自定义EditTextPreference:
public class MyEditTextPreferences extends EditTextPreference {
public MyEditTextPreferences(Context context) {
super(context);
}
public MyEditTextPreferences(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyEditTextPreferences(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
TextView titleView = (TextView) view.findViewById(android.R.id.title);
TextView summaryView = (TextView) view.findViewById(android.R.id.summary);
titleView.setTypeface(G.yekanfont);
summaryView.setTypeface(G.yekanfont);
}
}
以及这个:
<com.mydomain.mypackagename.MyEditTextPreferences
android:defaultValue="300"
android:dialogMessage="some text"
android:dialogTitle="some other text"
android:inputType="number"
android:key="DURATION_BETWEEN"
android:title="some text"
android:summary="some other text"
/>