2013-10-11 23 views
0

的休息,我有以下佈局安卓:獲取的EditText查看佔用屏幕

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal"> 
    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:text="Gross Pay" 
     /> 
    <EditText 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     android:hint="Gross Pay" 
     android:inputType="numberDecimal" 
     android:layout_weight="1" 
     /> 
</LinearLayout> 
<Button 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Continue" 
    /> 

</LinearLayout> 

正如你可以看到我已經試過所有我能想到的,使EditText上佔據屏幕的其餘部分,但是,我仍然沒有做正確的事情。在Eclipse中看起來很好,但是當我在模擬器中運行時,EditText不像我所期望的那樣展開。

任何人都能夠幫助

回答

0

笨蛋!發現這是一個片段,我不得不改變...

<fragment android:name="com.example.manageyobudget.fragment.GeneralTaxInformationFragment" 
     android:id="@+id/list" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" /> 

<fragment android:name="com.example.manageyobudget.fragment.GeneralTaxInformationFragment" 
     android:id="@+id/list" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 
+0

很高興聽到:) –

0

試試這個..如果你給重1意味着你需要給您要匹配父0dp ..

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal"> 
    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:text="Gross Pay" 
     /> 
    <EditText 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:hint="Gross Pay" 
     android:inputType="numberDecimal" 
     android:layout_weight="1" 
     /> 
</LinearLayout>