일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 아이폰 메모리 관리
- singular vector decomposition
- objective-c
- ios 메모리
- property 속성
- OCRS
- 딥러닝
- Property
- Machine Learning
- 행렬 분해
- 텐서
- 안드로이드
- 딥러닝 책
- spectral decomposition
- 스펙트럼 분해
- 머신러닝 책
- 딥러닝 첫걸음
- ios 메모리관리
- matrix decomposition
- Cross-origin resource sharing
- Objective c
- nonatomic
- CORS
- 기계학습
- retatin
- dot syntax
- 머신러닝
- TENSOR
- CORS c#
- 태그를 입력해 주세요.
Archives
- Today
- Total
One Step for A Little Progress
안드로이드 탭뷰(TabView) 만들기(Activity를 이용한 방법) 본문
1. xml 파일
<TabHost android:id="@+id/th_tabhost_mainpage" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="wrap_content"> </FrameLayout> </LinearLayout> </TabHost>
위와 같이 탭호스트 -> 탭위젯 -> 프레임 레이아웃 순으로 구성을 해준다. 이때 TabHost는 아이디를 원하는 아이디로 구성하고, TabWidget과 frameLayout은 지정된 레이아웃으로 정해준다.
그리고 이때 프레임 레이아웃에 탭안에 들어갈 뷰를 넣어주면 된다.(뷰를 넣을때 액티비티에서 아이디를 가져와 쓰기 때문에 아이디를 추가해주어야 한다.)
2. 액티비티 파 일
TabHost mTabHost=(TabHost)findViewById(R.id.th_tabhost_mainpage); mTabHost.setup(); mTabHost.addTab(mTabHost.newTabSpec("tab1").setIndicator("경조사").setContent(R.id.lv_celebration_mainpage)); mTabHost.addTab(mTabHost.newTabSpec("tab2").setIndicator("모임").setContent(R.id.lv_event_mainpage)); mTabHost.addTab(mTabHost.newTabSpec("tab3").setIndicator("업체홍보 및 문의").setContent(R.id.lv_jobad_mainpage)); mTabHost.setCurrentTab(0);
탭액티비티를 사용해서 구성할때와 마찬가지로 TabSpec을 생성해주고, Indicator를 통해서 이름을 정해준다. 그다음에는 content를 설정해준다. 위의 Bold처리된 부분에 FrameLayout에 넣었던 뷰들의 아이디를 넣어주면된다.
'Develop > Android' 카테고리의 다른 글
안드로이드 탭뷰(TabView) 탭에 액티비티 넣기(탭에 인텐트 넣기) (0) | 2012.03.30 |
---|---|
안드로이드 layout include하기 (0) | 2012.03.28 |
안드로이드 탭뷰(TabView) 탭 크기 조정 (0) | 2012.03.28 |
안드로이드 탭뷰(TabView) 만들기(TabActivity 상속한 방법) (0) | 2012.03.27 |
안드로이드 타이틀바(Titlebar 없애기) (0) | 2012.03.25 |
Comments