我不斷收到此錯誤消息,我不知道我應該做什麼。方法setOnClickListener(new View.OnClickListener(){})是未定義的類型imageButton1
方法setOnClickListener(new View.OnClickListener(){})
是未定義類型imageButton1
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
imageButton1 imagebutton1 = (imageButton1) findViewById(R.id.imageButton1);
imageButton1.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
ImageView iv = (ImageView) findViewById(R.id.imageview1);
iv.setVisibility(View.VISIBLE);
}
});
你錯過了一個導入? – psychotik 2012-02-12 08:05:37