실제로 내 탭의 오른쪽 하단에 커브를 표시하고 싶습니다. 어떻게 할 수 있습니까? 코드 ... 내가 사용한 코드 ..안드로이드에서 곡선 또는 둥근 탭을 만드는 방법
코드
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- When selected, use grey -->
<item android:drawable="@drawable/ic_tab_artists_white"
android:state_selected="true"
android:state_pressed="false" />
<!-- When not selected, use white-->
<item android:drawable="@drawable/ic_tab_artists_grey" />
</selector>
코드 된 .java 파일
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);
for (int j = 0; j < MainTabHost.getTabWidget().getChildCount(); j++)
{
((TextView)tabHost.getChildAt(j).findViewById(android.R.id.title)).setTextColor(Color.parseColor("#FFFFFF"));
((TextView)tabHost.getChildAt(j).findViewById(android.R.id.title)).setTextSize(16);
}
에 대한 두 번째 XML에 대한 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="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>
코드3210
이 내가 탭이 지금은 u는 아이디어를 얻을 수 아래의 우측 하단
당신이 가지고있는 것의 스크린 샷을 보여주고 달성하고자하는 것을 캡쳐 화면으로 보여줄 수 있습니까? – glenatron
나는 당신에게 스냅 샷 u를 보냈습니다. – AndroidDev