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
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

     
  • 相关阅读:
    mysql查的用法
    js和jquery的基本应用
    JS实现html页面点击下载文件
    十二、PHP变量以及变量间传值的用法
    十一、jQuery的基本用法
    十、MySQL的应用大全
    九、使用盒子布局 margin 与padding如何使用
    在 Apex 中使用合并统计查询
    Salesforce 的 package.xml 文件
    Salesforce 应用生命周期管理
  • 原文地址:https://www.cnblogs.com/killerlegend/p/3244072.html
Copyright © 2011-2022 走看看