배경 이미지를 설정하려는 Tabhost를 사용하고 있습니다. 그러나 설정 한 후,이TabHost의 배경 이미지를 올바르게 정렬하는 방법은 무엇입니까?
처럼 온다! [1]
어떻게 내가 완전히 설정할 수 있습니다 [여기 이미지 설명을 입력]? 아래 코드는 다음과 같습니다
/* Tabs */
Bundle bundle = getIntent().getExtras();
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
// First Activity
intent = new Intent().setClass(this, InfoListView.class);
//spec = tabHost.newTabSpec("some_things").setIndicator("Info").setContent(intent);
spec = tabHost.newTabSpec("top_things").setIndicator("Info",getResources().getDrawable(R.drawable.tabicon)).setContent(intent);
tabHost.addTab(spec);
// Second Activity
intent = new Intent().setClass(this, LogListView.class);
/*mContext = getApplicationContext();
TextView mTv = new TextView(mContext);
mTv.setText("Sync Log");
mTv.setBackgroundDrawable(mContext.getResources.getDrawable(R.drawable.tabicon));
spec = tabHost.newTabSpec("top_things").setIndicator(mTv).setContent(intent);*/
spec = tabHost.newTabSpec("top_things").setIndicator("Sync Log", getResources().getDrawable(R.drawable.tabicon)).setContent(intent);
tabHost.addTab(spec);
tabHost.getTabWidget().getChildAt(0).getLayoutParams().height = 95;
tabHost.getTabWidget().getChildAt(1).getLayoutParams().height = 95;
/* 탭
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/title" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
<View
android:id="@+id/separator"
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_below="@android:id/tabs" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/btnSend"
android:layout_below="@+id/separator"
android:paddingBottom="45dip" >
<!-- Scrollview for message data -->
<ScrollView
android:id="@+id/formTab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical" >
<LinearLayout
android:id="@+id/formLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<View
android:layout_width="fill_parent"
android:layout_height="5dip" />
</LinearLayout>
</ScrollView>
</FrameLayout>
</RelativeLayout>
</TabHost>
를 해결? –
예. 해결되었습니다. 나는 Text View와 setBackground를 사용해야했다. – user45678
괜찮아. 네가 직접 해결했다면. 다른 사람이 같은 문제가 생기면 답을 게시하십시오. 당신의 대답을 도와주세요. –