【发布时间】:2014-01-09 13:36:28
【问题描述】:
此处可能重复,抱歉……
我不知道如何将自定义样式添加到我的 DialogFragment。目前我有课
public final class SelectFragment extends DialogFragment {
我从应用程序的不同部分调用它。例如,来自我的“CreateInvoice”类:
private void showFragment(int selectedIndex) {
SelectFragment fragment = SelectFragment.newInstance(selectedIndex, getOnOptionSelectListener());
fragment.setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo_Light_Dialog);
fragment.show(getActivity().getSupportFragmentManager(), "");
}
我想要做的是将 fragment.setStyle 更改为自定义样式,例如使用我自己的配色方案作为边框、背景等的颜色。如果有人能指导我,我将不胜感激,因为这是我第一次使用片段。 :-)
谢谢!
【问题讨论】:
-
您应该搜索“自定义对话框片段 android”。你会得到答案.. :)
标签: java android android-fragments android-gui