안녕하세여.
정말 어디가서 말도 못할 정도로 쉬운거에서 막혔네여;;ㅠㅠㅠ
아이콘을 셀렉터로 지정해주었는데요,,, 화면상에 나타지를 않습니다. 버전은 4.0.3입니다.
.java 소스
package ria.pdf;
import android.app.TabActivity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
@SuppressWarnings("deprecation")
public class RiaPDFActivity extends TabActivity {
TabHost mTab;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mTab = getTabHost();
Drawable filelist = getResources().getDrawable(
R.drawable.filelist_sel);
Drawable filesave = getResources().getDrawable(
R.drawable.filesave_sel);
Drawable about = getResources().getDrawable(
R.drawable.gpl_sel);
TabSpec RFilelist = mTab.newTabSpec("파일").setIndicator("파일");
RFilelist.setIndicator("파일", filelist);
RFilelist.setContent(R.id.filelist);
mTab.addTab(RFilelist);
TabSpec RFilesave = mTab.newTabSpec("최근목록").setIndicator("최근목록");
RFilesave.setIndicator("최근목록", filesave);
RFilesave.setContent(R.id.filesave);
mTab.addTab(RFilesave);
TabSpec Rgpl = mTab.newTabSpec("About").setIndicator("About");
Rgpl.setIndicator("About", about);
Rgpl.setContent(R.id.gpl);
mTab.addTab(Rgpl);
mTab.setCurrentTab(0);
}
}
.xml
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000" >
<LinearLayout
android:id="@+id/linear1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<LinearLayout
android:id="@+id/filelist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:id="@+id/filesave"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:id="@+id/gpl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/filelist_down" android:state_pressed="true"/>
<!-- pressed -->
<item android:drawable="@drawable/filelist_down" android:state_selected="true"/>
<!-- selected -->
<item android:drawable="@drawable/filelist_up"/>
<!-- default -->
</selector>
오류가 먼지 너무 너무 궁금합니다.
혹시 @SuppressWarnings("deprecation") 이놈때문인지....
이거 안뜨게 하려면 어떻게 하는지 너무 궁금합니다 ㅠㅠㅠ
감사합니다




정확한 원인인지는 모르겠지만
TabSpec RFilelist = mTab.newTabSpec("파일").setIndicator("파일");
RFilelist.setIndicator("파일", filelist);
여기에서
setIndicator이게 중복사용됐네요.
그리고
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
이부분도 살짝 잘못사용하셨어요.. weight를 사용할려면 그 상위 linearlayout에 sumWeight인가 그걸 지정해주고사용하셔야해요.
근데 저 2개때문에 안보이는거같지는.. 음