我正在開發一個android應用程序。需要相同的分辨率爲Default(WVGA800)
HVGA
QVGA
和所有意味着模擬器的大小的模擬器應該無關緊要現在我有這xml file
,我需要修復大小的底部標籤欄爲什麼這麼說呢我呢?現在我面臨的問題是..我必須把tabbar的空間放在底部。所以,當我在Default(WVGA800)HVGA或QVGA中運行這個相同的應用程序時,它與標籤欄上的webview重疊,所以它看起來不好,應該怎麼做?我使用的是Android 1.6android分辨率需要幫助
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:id="@+id/rl"
android:layout_height="371dip">
<!-- <WebView android:id="@+id/webviewHelp" android:layout_width="fill_parent"-->
<!-- android:layout_height="fill_parent" />-->
<WebView android:id="@+id/webviewHelp" android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<Button android:id="@+id/My_btn"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" android:gravity="center" android:textSize="8px" android:text="Download this mp3 file"
android:textColor="@color/white"
android:layout_width="fill_parent" android:layout_height="33dip"
android:visibility="invisible" />
<Button android:id="@+id/My_btn1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" android:text="this is button !"
android:layout_width="0dip" android:layout_height="0dip"
android:visibility="invisible" />
</RelativeLayout>
這是我的TabBar活動類
final TabHost tabHost = (TabHost) getTabHost();
try {
//GlobalVariable.Setdownload(0);
tabHost.addTab(createTab(myclsname.class, "Welcome",
"Welcome", R.drawable.tab_icon_events));
tabHost.addTab(createTab(anotheclsname.class, ".Mp3List", ".Mp3List",
R.drawable.tab_icon_pitchforkfm));
tabHost.addTab(createTab(AboutUs.class, "AboutUs", "AboutUs",
R.drawable.tab_icon_home));
tabHost.addTab(createTab(ExtraInfromation.class, "ExtraInformation", "ExtraInformation",
R.drawable.tab_icon_tv));
tabHost.setCurrentTab(1);
} catch (Exception e) {
// TODO: handle exception
}
tabHost.getTabWidget().getChildAt(0).getLayoutParams().width = 85;
tabHost.getTabWidget().getChildAt(0).getLayoutParams().height=57;
tabHost.getTabWidget().getChildAt(1).getLayoutParams().width = 85;
tabHost.getTabWidget().getChildAt(2).getLayoutParams().width = 85;
tabHost.getTabWidget().getChildAt(3).getLayoutParams().width = 85;
tabHost.setOnTabChangedListener(new OnTabChangeListener() {
bla.. bla.. bla..
private TabSpec createTab(final Class<?> intentClass, final String tag,
final String title, final int drawable)
{
final Intent intent = new Intent().setClass(this, intentClass);
final View tab = LayoutInflater.from(getTabHost().getContext())
.inflate(R.layout.tab, null);
((TextView) tab.findViewById(R.id.tab_text)).setText(title);
((ImageView) tab.findViewById(R.id.tab_icon))
.setImageResource(drawable);
return getTabHost().newTabSpec(tag).setIndicator(tab)
.setContent(intent);
}
我應該怎麼做,上述問題將被解決?在此先感謝:Pragna
在具有不同分辨率的屏幕上的分辨率相同嗎?如果它甚至可能,它會看起來非常糟糕(例如在2x上運行ipad上的iphone應用程序)。 – trutheality 2011-06-11 04:11:21
查看我編輯的代碼 – Android 2011-06-11 04:28:55