2015-11-07 79 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

相关问题