2016-06-23 9 views
1

Androidで初めての「リアル」アプリケーションを作成する途中です。Androidプログラミング:完全にフラグメントをカバーしていない背景色

バックグラウンドカラーに問題があります。バックグラウンド全体が伸びないため、アプリの周りにボックスのようなグレーの線が残っています。

それがあるべきようにシミュレータ上で、それはそれを示しているが、私のエミュレータ上で(S、私はチェックして、複数の試してみました)、それは(PIC 2を参照)、以下を示しているので、私は一種の心配していた:
プレビュー: enter image description here

エミュレータ: enter image description here

レイアウトファイル:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#d8edc2"> 

    <TextView 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:text="Contact" 
     android:layout_marginTop="10dp" 
     android:layout_marginLeft="10dp" 
     android:textSize="24dp" 
     android:textStyle="bold" 
     android:textColor="#000" 
     /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Name" 
     android:paddingTop="16dp" 
     android:paddingLeft="10dp" 
     /> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:paddingLeft="10dp" 
     android:id="@+id/editTextSenderName" /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Email" 
     android:paddingLeft="10dp" 
     android:paddingTop="16dp"/> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/editTextSenderEmail" /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:paddingLeft="10dp" 
     android:text="Subject" 
     android:paddingTop="16dp"/> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/editTextSenderSubject" /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Message" 
     android:paddingLeft="10dp" 
     android:paddingTop="16dp"/> 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="textMultiLine" 
     android:lines="5" 
     android:id="@+id/editTextSenderMessage" /> 

    <Button 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="Send message" 
     android:paddingTop="10dp" 
     android:id="@+id/buttonSendMessage" /> 

</LinearLayout> 

何が問題なのでしょうか?

+1

をレイアウトをチェックあなたの 'Fragment'コンテナが入っています。 –

+0

コメントをいただきありがとうございますが、もっと具体的になるかもしれませんか?私はデフォルトのナビゲーションドロワーを使用しており、複数のレイアウトファイルに分散しています。 'activity_main、app_bar_main、content_main'、および' nav_header_main'があります。私の 'Fragment'が入っている正しいレイアウトを見つけることができたら、私は何を探していますか? –

+1

私はその既定のプロジェクトに精通していませんが、 'ViewGroup'(おそらく' FrameLayout')を探していて、 'Fragment'sが処理されます。あなたのコードでは、おそらく 'getFragmentManager()。replace(...)'のようなものがあります。あなたはその呼び出しの最初の引数として渡されるIDを持つ 'ViewGroup'を探しています。 –

答えて

1

あなたの説明によると、私はレイアウトproblem.Youの活動は、次のコードがあるかどうかを確認し、あなたのレイアウトXMLファイルをチェックしていると思います:

android:paddingBottom="@dimen/activity_vertical_margin" 
 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
 
    android:paddingRight="@dimen/activity_horizontal_margin" 
 
    android:paddingTop="@dimen/activity_vertical_margin"

関連する問題