A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 曹伟 中级黑马   /  2013-9-18 16:33  /  3369 人查看  /  3 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="match_parent"
  4.     android:layout_height="match_parent"
  5.     android:orientation="horizontal">
  6.    
  7.    <GridView  
  8.         android:id="@+id/GridView1"  
  9.         android:layout_width="fill_parent"  
  10.         android:layout_height="wrap_content"
  11.         android:numColumns="4"></GridView>

  12. </LinearLayout>
复制代码
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="wrap_content"
  4.     android:layout_height="wrap_content">
  5.      <ImageView   
  6.                android:id="@+id/ItemImage"   
  7.                android:layout_width="wrap_content"
  8.                android:layout_height="wrap_content">   
  9.          </ImageView>
  10. </LinearLayout>
复制代码
现在运行出来,每行显示四张图片,如果屏幕太宽的话,图片之间就会有间隙,怎样调整才能没有间隙,图片在一行中居中呢?感谢!

评分

参与人数 1技术分 +1 收起 理由
EYE_SEE_YOU + 1

查看全部评分

3 个回复

倒序浏览
好久没有看Android,我当时是看这篇文章解决的,你可以看一下,http://fonter.iteye.com/blog/781403希望可以帮到你。
回复 使用道具 举报
比烟花寂寞_neve 发表于 2013-9-18 17:17
好久没有看Android,我当时是看这篇文章解决的,你可以看一下,http://fonter.iteye.com/blog/781403希望可 ...

谢谢你!
回复 使用道具 举报

我是黑马新手,以后多多支持
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马