当我运行下面的代码时,它会在日志文件中打印“null”......它有什么问题?
ProgressBar progressBar = (ProgressBar)findViewById(R.id.progressBar1);
if (progressBar == null) {
Log.d("tag", "null");
}
xml调用是:
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="37dp"
android:layout_y="343dp" />