热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Android布局设计与完美对齐-Androidlayoutdesignwithperfectalignment

itrytodesignlayoutwithlinearlayoutverticalandhorizontaltodesignmultiplerowwithtwoco

i try to design layout with linear layout vertical and horizontal to design multiple row with two column and try to perfect alignment of right column, but columns are shift right and left on left column's word number... how can i fix this problem,help me...

我尝试设计垂直和水平线性布局的布局设计多行有两列,并尝试完美对齐右列,但列左右列左右移动...如何解决这个问题,帮助我...

enter image description here

and my xml is....

我的xml是......




    

        

            
        

        

            
        
    

    

        

            
        

        

            
        
    


6 个解决方案

#1


2  

Try this..

尝试这个..

Change all LinearLayout width android:layout_ to android:layout_ like below.

将所有LinearLayout宽度android:layout_width =“wrap_content”更改为android:layout_width =“0dp”,如下所示。


to


#2


1  

Please try to use this layout code.

请尝试使用此布局代码。



    

        
    

    

        
    




    

        
    

    

        
    

#3


0  

You should use the TableLayout for this kind of designs. You will get more information over here. http://developer.android.com/reference/android/widget/TableLayout.html

您应该使用TableLayout进行此类设计。您将在此处获得更多信息。 http://developer.android.com/reference/android/widget/TableLayout.html

#4


0  

Try this code for aligned layout. If you are using this layout as a custom layout for listview then remove the second linear layout and use with your listview.

尝试使用此代码进行对齐布局。如果您将此布局用作列表视图的自定义布局,则删除第二个线性布局并与列表视图一起使用。



    

        

        
    

    

        

        
    


#5


0  

Try This

尝试这个

enter image description here

 

        

            

            

        

        

            

            

        
    

#6


-1  

If you want to create multiple rows, better you can choose Listview. Compare to adding multiple layout, Listview is the better choice. Here is the simple sample to handle listview.

如果要创建多行,最好选择Listview。与添加多个布局相比,Listview是更好的选择。这是处理listview的简单示例。


推荐阅读
author-avatar
mrkly_825
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有