zoukankan      html  css  js  c++  java
  • TextView中gravity属性值测定

    Attributes Explain
    top 不改变控件大小,对齐到容器顶部
    bottom 不改变控件大小,对齐到容器底部
    left 不改变控件大小,对齐到容器左侧
    right 不改变控件大小,对齐到容器右侧
    center_vertical 不改变控件大小,对齐到容器纵向中央位置
    center_horizontal 不改变控件大小,对齐到容器横向中央位置
    center 不改变控件大小,对齐到容器中央位置
    fill_vertical 若有可能,纵向拉伸以填满容器
    fill_horizontal 若有可能,横向拉伸以填满容器
    fill 若有可能,纵向横向拉伸以填满容器

    在TableLayout布局中,出现了以下警告:

    This TableRow layout or its TableLayout parent is useless

    解决办法很简单,比如你原来的代码可能是:

     
    1. <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    2.     android:layout_width="fill_parent"  
    3.     android:layout_height="fill_parent" >  
    4.        
    5.     <TableRow>  
    6.          <TextView/>  
    7.          <TextView/>  
    8.     </TableRow>  
    9.        
    10.   
    11. </TableLayout>  

    你只需改为下面的即可:

    1. <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    2.     android:layout_width="fill_parent"  
    3.     android:layout_height="fill_parent" >  
    4.        
    5.     <TableRow>  
    6.          <TextView/>  
    7.          <TextView/>  
    8.     </TableRow>  
    9.     <TableRow>  
    10.          <TextView/>  
    11.          <TextView/>  
    12.     </TableRow>  
    13.   
    14. </TableLayout>  
    
    


    作者:KillerLegend
    出处:http://www.cnblogs.com/KillerLegend/
    分享最新的资源,分享个人所得,欢迎关注我的新浪微博
    新浪微博主页:ikey4u
    我的个人博客:www.ikey4u.com
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

     
  • 相关阅读:
    【全程NOIP计划】分治与倍增
    apple id 后端验证 django
    安装Tomcat8,在Eclipse中配置Tomcat8
    CURL并发测试POST和DELETE请求
    curl如何发起DELETE/PUT请求?(备忘)
    Ubuntu 11.10下安装配置Zend Studio 9.0破解版详细步骤
    RTP QOS
    RTCP
    DirectDraw基础篇
    RTSP简介
  • 原文地址:https://www.cnblogs.com/killerlegend/p/3244072.html
Copyright © 2011-2022 走看看