0
我試圖實現類似的結果:類似於人的動態佈局應用程式
凡接觸可能會或可能不會有電子郵件地址或其他個人資料。是否有可能通過XML來實現其大部分,還是都需要通過Java來完成?
這裏是我想象將是一個溶液中的僞代碼:
如果(contact.hasPhoneNumber)在接觸
的foreach數
膨脹r.layout.contact_number
的setText PHONENUMBER textview
添加視圖到佈局
是否有更智能的方法?
如果你想要一個幾乎純粹的XML的方法,你可以每寫你的XML查看你可能需要,然後在你不需要它們時隱藏它們。 –