実際には、タブのホストを作成しました。各タブの背景を各タブの間に半透明で表示するよう設定しました。私のコードとスナップショットを送信しています私answer..so誰... ...どのように私はこれらの問題にXMLのタブホストの背景を半透明にする問題
コードを解決できるJava用
<?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="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<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="fill_parent"
/>
</LinearLayout>
</TabHost>
コードを私に提案してください
//create tabs
Resources res = getResources();
final TabHost MainTabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
MainTabHost.getTabWidget().setStripEnabled(false);
//call calendar Activity class
intent = new Intent().setClass(this, CalendarForm.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
spec = MainTabHost.newTabSpec(res.getString(R.string.text_tabHost1)).setIndicator("Calendar",
res.getDrawable(R.drawable.calendar_ic)).setContent(intent);
MainTabHost.addTab(spec);
//call History Activity class
intent = new Intent().setClass(this, HistoryForm.class);
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
spec = MainTabHost.newTabSpec(res.getString(R.string.text_tabHost2)).setIndicator("History",
res.getDrawable(R.drawable.calendar_ic)).setContent(intent);
MainTabHost.addTab(spec);
//call Statistic Activity class
intent = new Intent().setClass(this, StatisticForm.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
spec = MainTabHost.newTabSpec(res.getString(R.string.text_tabHost3)).setIndicator("Statistic",
res.getDrawable(R.drawable.calendar_ic)).setContent(intent);
MainTabHost.addTab(spec);
//setbackground Style of tabHost
MainTabHost.setCurrentTab(0);
MainTabHost.getTabWidget().setWeightSum(3);
final TabWidget tabHost=getTabWidget();
MainTabHost.setBackgroundResource(R.drawable.back_image);
//set background translucent..
MainTabHost.getTabWidget().getChildAt(0)setBackground(#50000000);
MainTabHost.getTabWidget().getChildAt(1).setBackground(#50000000)
MainTabHost.getTabWidget().getChildAt(2).setBackground(#50000000)
あなた自身のドロウアブルを作成しましたか?彼らは同じサイズではありませんか? – Jack
yeh彼らは同じサイズです – AndroidDev