我在12個按鈕的滾動視圖中有一個相關佈局。在每個按鈕上單擊一個圖像顯示所有作品,但我可以在背景中看到圖像,但仍然有圖像頂部的所有按鈕。有沒有隱藏這些按鈕的方法?我真的不想使用滑動抽屜,但如果我必須我會。在此先感謝如何在顯示圖像時隱藏按鈕
好了,所以這是我的類:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.campfacilities);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
final ImageView imageView = (ImageView) findViewById(R.id.img1);
Button next = (Button) findViewById(R.id.aimage);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.image1));
}
});
我怎麼會那麼實現
button.setVisibility(View.GONE);
所有的按鈕都顯示出來,但是當我將它設置爲不存在時,我無法點擊它。我想點擊它和所有的按鈕消失,然後讓我們回來,當我想選擇別的東西。 – Allrounder