Inflation이란?

  • XML 레이아웃게 정의된 정보를 메모리에 객체로 만드는 객체화 과정
  • ID를 지정하여 이 ID를 이용해 자바 코드에서 객체를 찾음


아래와 같이 layout 하위에 'screenview.xml'이 있을 때


이렇게 Inflation 할 수 있다.

// Layout inflation
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.screenview, this, true);


+ Recent posts