2016-04-23 53 views

回答

0

將佈局XML文件實例化爲其相應的View對象。它從不直接使用。而是使用getLayoutInflater()getSystemService(Class)來檢索標準的LayoutInflater實例,該實例已連接到當前上下文並正確配置了您正在運行的設備。例如:

LayoutInflater inflater = (LayoutInflater)context.getSystemService 
    (Context.LAYOUT_INFLATER_SERVICE); 

official documentation here