bt1.findViewById(R.id.layout);也能用為什么?
private Button bt1;
bt1.findViewById(R.id.layout);
和
bt1 = (Button)findViewById(R.id.layout);
的區別是什么
private Button bt1;
bt1.findViewById(R.id.layout);
和
bt1 = (Button)findViewById(R.id.layout);
的區別是什么
2017-03-08
舉報
2017-03-08
沒有什么本質上的去別,都差不多,不過就是沒有聲明這是一個Button,建議最好就用第二種
2017-03-08
沒有什么本質上的去別,都差不多,不過就是沒有聲明這是一個Button,建議最好就用第二種