在Android中,如何在不使用findViewByID的情况下显示图像?
我试图使一个图像出现在if语句中,但它不喜欢findviewbyd,那么是否有其他方式显示图像-错误表示无法解析为变量在Android中,如何在不使用findViewByID的情况下显示图像?,android,Android,我试图使一个图像出现在if语句中,但它不喜欢findviewbyd,那么是否有其他方式显示图像-错误表示无法解析为变量 public boolean play(int column){ for (int r = 0; r <= 5;r++){ if (getState(column, r) == State.BLANK){ if (player1Turn == true){ count[column][
public boolean play(int column){
for (int r = 0; r <= 5;r++){
if (getState(column, r) == State.BLANK){
if (player1Turn == true){
count[column][r] = State.RED;
//image
ImageView redCounter = (ImageView) findViewById.(R.id.redCounter);
//end
}else {
公共布尔播放(int列){
对于(int r=0;r代码中的问题是findViewById之后的点(.)。
ImageView redCounter = (ImageView) findViewById.(R.id.redCounter);
就这样把它去掉
ImageView redCounter = (ImageView) findViewById(R.id.redCounter);
代码中的问题是findViewById之后的点(.)。
ImageView redCounter = (ImageView) findViewById.(R.id.redCounter);
就这样把它去掉
ImageView redCounter = (ImageView) findViewById(R.id.redCounter);
它不喜欢findviewbyId
-这是什么意思?给定此错误无法解析为变量它不喜欢findviewbyId
-这是什么意思?给定此错误无法解析为变量