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

     
  • 相关阅读:
    socket.io
    CUDA升级后
    QT安装
    windows时钟服务设置
    QT的DPI支持
    cudaDeviceProp结构体
    C#调用C++的dll各种传参
    「LibreOJ#516」DP 一般看规律
    「LibreOJ#515」贪心只能过样例 (暴力+bitset)
    [Codeforces888E]Maximum Subsequence(暴力+meet-in-the-middle)
  • 原文地址:https://www.cnblogs.com/killerlegend/p/3244072.html
Copyright © 2011-2022 走看看