三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。1)fill_parent设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间。这跟Windows控件的dockstyle属性大体一致。设置一个顶部布局或...
                            
                            
                                分类:
移动开发   时间:
2014-08-09 11:25:07   
                                阅读次数:
215
                             
                         
                    
                        
                            
                            
                                在android开发过程中,对于控件的高度,宽度,虽然在xml中用android:layout_height="match_parent"设置了 高度(match_parent和fill_parent是一样的,2.2版本后就用match_parent代替fill_parent了。)但有时, 程序需要...
                            
                            
                                分类:
移动开发   时间:
2014-08-07 12:27:09   
                                阅读次数:
324
                             
                         
                    
                        
                            
                            
                                定义一个布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height=...
                            
                            
                                分类:
移动开发   时间:
2014-08-03 15:25:05   
                                阅读次数:
204
                             
                         
                    
                        
                            
                            
                                布局文件中定义一下UI,虽然没什么UI.....
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    androi...
                            
                            
                                分类:
移动开发   时间:
2014-08-02 15:40:23   
                                阅读次数:
301
                             
                         
                    
                        
                            
                            
                                先上效果图:
Layout文件:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    and...
                            
                            
                                分类:
移动开发   时间:
2014-08-01 23:18:22   
                                阅读次数:
489
                             
                         
                    
                        
                            
                            
                                有时我们在做多行EditText的时候会出现光标在中间的问题:
<EditText 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minLines="5"
    android:background="#ffffff"
    android:paddi...
                            
                            
                                分类:
其他好文   时间:
2014-07-31 21:03:17   
                                阅读次数:
308
                             
                         
                    
                        
                            
                            
                                定义的getView执行多次的ListView布局:
 <ListView
        android:id="@+id/lv_messages"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParent...
                            
                            
                                分类:
移动开发   时间:
2014-07-30 20:58:54   
                                阅读次数:
256
                             
                         
                    
                        
                            
                            
                                首先声明只有在Linearlayout中,该属性才有效。之所以android:layout_weight会引起争议,是因为在设置该属性的同时,设置android:layout_width为wrap_content和match_parent会造成两种截然相反的效果。android:layout_wei...
                            
                            
                                分类:
移动开发   时间:
2014-07-29 11:41:16   
                                阅读次数:
228
                             
                         
                    
                        
                            
                            
                                如何设置list view中的item的高度呢?示例如下: //直接在这里设置高度是不会生效的。 按照如下修改: 另外,如何避免list view adapter反复getivew?list view在layout种设置时width/height 为match_parent. 或...
                            
                            
                                分类:
其他好文   时间:
2014-07-28 21:23:44   
                                阅读次数:
226
                             
                         
                    
                        
                            
                            
                                1.布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:orientation=...
                            
                            
                                分类:
移动开发   时间:
2014-07-28 16:04:13   
                                阅读次数:
264