职业IT人-IT人生活圈

 找回密码
 成为会员
搜索
查看: 472|回复: 2

Android杂谈---layout_x与layout_y的正确使用

[复制链接]
爱车车 发表于 2011-7-20 09:20 | 显示全部楼层 |阅读模式
  1. <?xml version="1.0" encoding="utf-8"?>   
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="vertical"  
  4.     android:layout_width="fill_parent"  
  5.     android:layout_height="fill_parent"  
  6.     >   
  7. <TextView     
  8.     android:layout_width="fill_parent"   
  9.     android:layout_height="wrap_content"   
  10.     android:id="@+id/mytext"  
  11.     />   
  12. <EditText   
  13.     android:id="@+id/edittext"  
  14.     android:layout_width="fill_parent"  
  15.     android:layout_height="wrap_content"  
  16.     android:textSize="10pt"  
  17.     <SPAN style="COLOR: #000000">android:layout_x="30px"  
  18.     android:layout_y="30px"</SPAN>   
  19. />   
  20. </LinearLayout>  

  21. <?xml version="1.0" encoding="utf-8"?>
  22. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  23.     android:orientation="vertical"
  24.     android:layout_width="fill_parent"
  25.     android:layout_height="fill_parent"
  26.     >
  27. <TextView  
  28.     android:layout_width="fill_parent"
  29.     android:layout_height="wrap_content"
  30.     android:id="@+id/mytext"
  31.     />
  32. <EditText
  33.         android:id="@+id/edittext"
  34.         android:layout_width="fill_parent"
  35.         android:layout_height="wrap_content"
  36.         android:textSize="10pt"
  37.         android:layout_x="30px"
  38.         android:layout_y="30px"
  39. />
  40. </LinearLayout>
  41. android:layout_x="30px"
  42. android:layout_y="30px"
复制代码
红色字体标出来的是我要说的
这两句话只有用在AbsoluteLayout中才会看到效果,而一般的默认的LinearLayout,或者其他布局
加入这两句话属于废话,没有用


gz-vps 发表于 2011-7-20 09:20 | 显示全部楼层
看晕了。

北大青鸟 发表于 2011-7-20 10:34 | 显示全部楼层
支持你一下下。。
您需要登录后才可以回帖 登录 | 成为会员

本版积分规则

QQ|手机版|小黑屋|网站帮助|职业IT人-IT人生活圈 ( 粤ICP备12053935号-1 )|网站地图
本站文章版权归原发布者及原出处所有。内容为作者个人观点,并不代表本站赞同其观点和对其真实性负责,本站只提供参考并不构成任何投资及应用建议。本站是信息平台,网站上部分文章为转载,并不用于任何商业目的,我们已经尽可能的对作者和来源进行了通告,但是能力有限或疏忽造成漏登,请及时联系我们,我们将根据著作权人的要求立即更正或者删除有关内容。

GMT+8, 2024-4-30 02:13 , Processed in 0.133210 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表