Android LayoutInflator

    技术2022-05-18  17

       

        This class is used to instantiate layout XML file into its corresponding View objects. It is never be used directly -- use  getLayoutInflater()   or  getSystemService(String)   to retrieve a standard LayoutInflater instance that is already hooked up to the current context and correctly configured for the device you are running on.

    hook up:用钩钩住,  将 ... 联接起来

     

    LayoutInflater与findViewById的用法有很多可比较之处。

    如:他们都可以通过id返回View。

    LayoutInflater inflater = getLayoutInflater();

    View layout = inflater.inflate(R.layout.custom_dialog,null);

    Button button = (Button) findViewById(R.id.button);

     

    correctly:

    cor·rect·ly

    [kə'rektli]

    adv.   正确地,  恰当地

    adv.  He answered the teacher's question correctly . adv.  他正确地回答了老师的问题。

    retrieve:

    re·trieve

    [ri'tri:v]

    vt.  恢复, 挽回, 取回

    vt.  The company is fighting to retrieve its market share.

     

     

    correspond:

    cor·re·spond

    [.kɔris'pɔnd, .kɔri'spɔnd]    vi.  符合, 相当, 通信 vi.  Your account of events corresponds with hers. vi.  

    你说的情况跟她说的相符。


    最新回复(0)