2015-11-07 83 views
0

我是android的新的,當我嘗試運行我的代碼,我只是讓我的智能手機和仿真器之間輸精管結果GridView控件行爲不同的手機和模擬器

在我的手機的Android版本是棒棒糖5 的Android版本模擬器是棒棒糖4

這張照片從手機

enter image description here

這張照片從模擬器

enter image description here

,這是我的代碼

<GridLayout 
    android:layout_width="match_parent" 
    android:layout_height="300dp" 
    android:columnCount="2" 
    android:rowCount="2" 
    > 

    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_column="0" 
     android:layout_row="0" 
     android:layout_columnWeight="1" 
     android:layout_rowWeight="1" 
     android:layout_gravity="fill" 
     /> 

    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_column="1" 
     android:layout_row="0" 
     android:layout_columnWeight="1" 
     android:layout_rowWeight="1" 
     android:layout_gravity="fill" 
     /> 


    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_column="0" 
     android:layout_row="1" 
     android:layout_columnWeight="0" 
     android:layout_rowWeight="1" 
     android:layout_columnSpan="2" 
     android:layout_gravity="fill" 
     /> 


</GridLayout> 

回答

0

重量不由網格佈局支持,直到API 21.如果你希望它得到支持,你可能需要使用網格佈局從支持庫V7

相關問題