| 

.NET C# Java Javascript Exception

4
Ich schreibe gerade eine App auf der Basis der "Tab Layout"-Dokumentation des Android SDKs. Bisher habe ich im Grunde nicht viel mehr als das Tutorial fertig, jedoch würde ich gern noch einen minimalen Punkt am Ergebnis ändern: Wenn das Smartphone im Querformat liegt, sollen die Tabs rechts oder links (statt oben) auftauchen. Im Querformat nehmen sie oben einfach zu viel Fläche weg. Wo muss ich dafür ansetzen? Geht das überhaupt?

Meine main.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" android:padding="5dp">
<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" android:padding="5dp" />
</LinearLayout>
</TabHost>

Meine Standard-Activity (Auszug aus BillardScores.java):
public class BillardScores extends TabActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources(); // Resource object to get Drawables
TabHost tabHost = getTabHost(); // The activity TabHost
TabHost.TabSpec spec; // Resusable TabSpec for each tab
Intent intent; // Reusable Intent for each tab
intent = new Intent().setClass(this, AllMatchesActivity.class);
spec = tabHost.newTabSpec("allmatches").setIndicator("Spiele",res.getDrawable(R.drawable.icon_red)).setContent(intent);
tabHost.addTab(spec);
// ... weitere Tabs einbauen ...
tabHost.setCurrentTab(0);
}
}[
/code]
Und die AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.myname.BillardScores" android:versionCode="1" android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="BillardScores" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="SingleMatchActivity" android:label="@string/app_name"></activity>
<activity android:name="NewMatchActivity" android:label="@string/app_name"></activity>
<activity android:name="AllMatchesActivity" android:label="@string/app_name"></activity>
<activity android:name="ScoreTableActivity" android:label="@string/app_name"></activity>
</application>
</manifest>

Alles in allem Basis-Code, sehr nah am Tutorial. Sieht auch gut aus. Nur im Querformat nehmen die Tabs zu viel Platz ein, weil sie halt oben sind. Wie krieg ich sie dann nach rechts?
News:
28.07.2011
Sky 51 1