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

     
  • 相关阅读:
    致21岁的自己
    nginx 入门实战
    软件测试的分类
    Springboot 使用 Jedis
    NodeJS模块、包、NPM
    NodeJS介绍
    毫秒必争,前端网页性能最佳实践--转载
    IT主要在线学习网站
    电商峰值系统架构设计--转载
    查看w3wp进程占用的内存及.NET内存泄露,死锁分析--转载
  • 原文地址:https://www.cnblogs.com/killerlegend/p/3244072.html
Copyright © 2011-2022 走看看