若對尊貴或贊助會員有任何疑問,歡迎向我們查詢。我們的即時通或MSN: admin@eyny.com
- package tw.com.uch.itilab.eva;
- import android.content.Context;
- import android.widget.ImageView;
- import android.widget.RelativeLayout;
- class parper extends RelativeLayout {
- ImageView[] body;
- /*
- * 0 - 頭髮(後)
- * 1 - 頭
- * 2 - 身體
- * 3 - 眼睛
- * 4 - 鼻子
- * 5 - 嘴巴
- * 6 - 頭髮(前)
- * 7 - 衣服
- * 8 - 飾品
- */
- public parper(Context context) {
- super(context);
- body = new ImageView[9];
- for (int i = 0; i < body.length; i++){
- body[i] = new ImageView(context);
- this.addView(body[i]);
- }
- }
- void setHaira(int resId){
- body[0].setImageResource(resId);
- }
- void setHead(int resId){
- body[1].setImageResource(resId);
- }
- void setBody(int resId){
- body[2].setImageResource(resId);
- }
- void setEyes(int resId){
- body[3].setImageResource(resId);
- }
- void setNose(int resId){
- body[4].setImageResource(resId);
- }
- void setMouse(int resId){
- body[5].setImageResource(resId);
- }
- void setHairb(int resId){
- body[6].setImageResource(resId);
- }
- void setClothes(int resId){
- body[7].setImageResource(resId);
- }
- void setDecoration(int resId){
- body[8].setImageResource(resId);
- }
- }
複製代碼 我只要呼叫setXXXXX等函數超過4次就掛掉了,請問是什麼原因,該如何解決呢?... |