其实呢就是想做一个和输入法弹出差不多的效果

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>

<RelativeLayout
android:id="@+id/mediaPopup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:visibility="gone"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="I am a media player!"
/>
</RelativeLayout>

</RelativeLayout>
function void showMediaPlayer() {

if(mMediaPopUp.getVisibility() == View.GONE) {

// Show Media Player
TranslateAnimation mAnimUp =
new TranslateAnimation(
Animation.RELATIVE_TO_SELF,
0,
Animation.RELATIVE_TO_SELF,
0,
Animation.RELATIVE_TO_SELF,
-(mMediaPopUp.getHeight()),
Animation.RELATIVE_TO_SELF,
0);

mAnimUp
.setStartOffset(500);
mAnimUp
.setDuration(500);

mMediaPopUp
.setVisibility(View.VISIBLE);
mMediaPopUp
.setAnimation(mAnimUp);

}
}

更多相关文章

  1. android studio 格式化代码时注解不换行
  2. android TextView 实现自定义文字点击效果
  3. Android中的Button自定义点击效果
  4. material design 的android开源代码整理
  5. android中图片倒影、圆角效果重绘
  6. android使用xml实现虚线效果
  7. Android(安卓)软键盘问题总结
  8. Android:实现类似RadioButton自动换行及单选效果
  9. Android(安卓)中带有进度条效果的按钮(Button)

随机推荐

  1. Android之Dialog集合
  2. Android在Adapter里面调用Activity的方法
  3. android百度地图:ItemizedOverlay
  4. ffmepg x264 fdk-aac android ndk全CPU编
  5. Android(安卓)实现微信,微博,微信朋友圈,QQ
  6. android 调试 报错
  7. android 渐变的半圆进度条
  8. Android(安卓): 反射机制获取或设置系统
  9. iOS、Android获取文件头信息
  10. 在Eclipse 中关联android sdk 源代码