1)想要ListView活着Girdview左右留些空隙,但Scrollbar要在屏幕最右边

在xml中加入

android:paddingLeft="8dp"android:paddingRight="8dp"android:scrollbarStyle="outsideOverlay"

2)用XML实现一个圆角矩形的drawable

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle" >    <corners android:radius="8dp" />    <solid android:color="#ffffffff" /></shape>

如果想要动态的改变圆角矩形的背景色

GradientDrawable gd = new GradientDrawable();// 设置圆角gd.setCornerRadius(8f);// 设置颜色gd.setColor(0xffffffff); 

3) 在layout的xml中加入

android:animateLayoutChanges="true"

api level 大于等于11,在当布局改变的时候,会有动画效果

4) 如果使用了FrameLayout,并且用到了Margin,记得给FrameLayout设置一个android:layout_gravity,在2.2/2.3系统上,如果没有设置gravity,

Margin是无效的,算是一个系统的bug吧。

更多相关文章

  1. android的网络编程
  2. Android基础入门教程——2.2.1 LinearLayout(线性布局)
  3. activity属性设置大全
  4. 预显示TextView
  5. android 4中新增的日历处理相关API
  6. android模仿铃声选择功能
  7. Android(安卓)build system 分析之 envsetup.sh
  8. Android访问权限大全
  9. android键盘挡住界面

随机推荐

  1. [转]Android 应用初始化及窗体事件(按键)的
  2. 关于Android内存泄漏的种种总结第二弹
  3. Android Studio 设置背景色
  4. android studio中出现的问题
  5. Android的内存管理
  6. Layout开发小技巧(三)
  7. Android面试题——Activity
  8. Android 进度条功能实现
  9. Android 使用SVG
  10. Android(安卓)LottieAnimation使用---踩