因为DialogFragment 本身带有findViewById的方法,所以只要下面这样就可以了。
View v = inflater.inflate(R.layout.dialog_key, container, false);
Button spellButton=(Button)v.findViewById(R.id.radio_spell);
spellButton.setOnClickListener(this);