[問題] extends layout問題

看板AndroidDev作者 ( who)時間13年前 (2012/03/28 17:53), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/1
class GridItem extends Layout{ private ImageView iv; private TextView tv; } xml http://pastebin.com/zuNqDLem 希望gridItem的iv,tv對到xml中的 imageview,textview 我查到的做法是constructor內 LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(context.LAYOUT_INFLATER_SERVICE); View view=layoutInflater.inflate(R.layout.griditem,this); 不過好像沒有用 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.168.20.236

03/28 18:09, , 1F
改成extends LinearLayout試試
03/28 18:09, 1F

03/28 21:08, , 2F
你應該用LinearLayout才對
03/28 21:08, 2F

03/29 20:33, , 3F
試了 好像沒什麼差
03/29 20:33, 3F
文章代碼(AID): #1FSj-k6O (AndroidDev)