-1
Android視圖在xml文件中,我們可以將n個拖放控件拖放到它,但現在我想要在java中創建一個while循環的圖像和鏈接按鈕,這意味着我們必須從後端開發接口部分,我們如何才能這樣做?如何在Android中創建圖像和鏈接按鈕(java)?
Android視圖在xml文件中,我們可以將n個拖放控件拖放到它,但現在我想要在java中創建一個while循環的圖像和鏈接按鈕,這意味着我們必須從後端開發接口部分,我們如何才能這樣做?如何在Android中創建圖像和鏈接按鈕(java)?
ImageButton inherits from ImageView and has its own properties compared to Button properties.
you can check properties here,
http://developer.android.com/reference/android/widget/ImageButton.html
Make your activity implement OnClickListener, then in OnCreate() or after that event. use ,
ImageButton btn = new ImageButton(this); or
//ImageButton btn = (ImageButton) findViewById(R.id.imgbtnid)
btn.setOnClickListener(this);
in onClick() function you can handle the click event
好的。你能解釋一下你做了什麼:) –