인플레이션(inflation)을 통해 탭 위젯 구현하기

 

인플레이션 구현 복습

해당 액티비티의 객체를 연결해 주는 infalter를 전달받고 그 inflater에 Layout과 TabHost를 등록

LayoutInflater inflater = LayoutInflater.from(this);

inflater.inflate(R.layout.main, mytabhost.getContentview(), true);

 

 

탭 위젯 구현하기

탭 호스트 spec을 만들고 sepc에 Indicator와 setContent를 해 주고 나서

탭 호스트에 spec객체를 addTab();

TabHost mytabhost;

TabHost.TabSpec spec = mytabhost.new TabSpec("tag");

spec.setIndicator("탭이름"(;

spec.setContent(R.id.Layoutid);

mytabhost.addTab(spec);

 

 

by wisegirl 2013. 3. 19. 13:05