进度条总是返回 null
public void calcola(View view) {
final Dialog myDialog = new Dialog(this);
myDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
myDialog.setContentView(R.layout.calcdialog);
myDialog.setCancelable(false);
Typeface typeFace = Typeface.createFromAsset(getAssets(),"font/Flower.ttf");
mProgress = (ProgressBar) findViewById(R.id.ProgressBar);
TextView calc = (TextView) myDialog.findViewById(R.id.textView1);
calc.setTypeface(typeFace);
myDialog.show(); }
这是我的xml
<ProgressBar
android:id="@+id/ProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:maxHeight="30dp"
android:minHeight="30dp" />
相同布局中的文本视图完美运行,知道吗?
谢谢