0

私は Android を初めて使用し、TabActivity アプリの開発に関する Android 開発者 Web サイトのチュートリアルを再利用しようとしましたが、残念ながら、説明されているのとまったく同じ方法で構築しても機能しませんでした… デバッガーを使用して問題はメインレイアウトにあるようです。

-> setContentView(R.layout.main); //After this line the app stops.

ここに私の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>

誰かが同じ問題を抱えていた場合、または誰かがアドバイスを持っているなら、彼らは大歓迎です:)

タンクがいっぱい!

ランディ

4

1 に答える 1

1

投稿した xml はTabHost の例と同じで、問題はありません。コードに何かが含まれている必要があります。

コードを投稿してください。そうしないと、お手伝いできません。

于 2010-11-17T10:05:12.583 に答える