<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:gravity="center"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    >    <ImageView    android:id="@+id/logo"    android:src="@drawable/logo"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    /></LinearLayout> 

在代码中linearlayout的设置切忌不要用LinearLayout.LayoutParams 设置gravity。要用linearlayout.setGravity(。。。)设置

然后把imageview放进去

更多相关文章

  1. android图片切换ImageSwichter的动画切换效果
  2. android图片切换ImageSwichter的动画切换效果
  3. Android标题栏的各种设置
  4. android:layout_height="match_parent"和android:layout_marginT
  5. Android之android:padding和android:layout_margin的区别
  6. Android(安卓)EditText inputType同时设置textPassword和phone
  7. Android(安卓)TextView 文字居中
  8. Android(安卓)Studio 的原生输入框控件 EditText 属性配置详解
  9. android:layout_gravity和android:gravity

随机推荐

  1. Android(安卓)SDK Android(安卓)NDK Andr
  2. Marquee 跑马效果
  3. 【Android】AS环境下,在布局中使用android
  4. android 打开APN
  5. android
  6. Android开发资源
  7. 【Android开发】Android入门安装与使用教
  8. android:scaleType属性
  9. Android(安卓)Studio解除65K限制
  10. App for Android(安卓)(2) —— Python篇