애니메이션 (안드로이드 프로젝트에서)을 사용하여 WindowManager에서 뷰를 부 풀릴 수있는 방법이 있습니까? 사이트의 예제를 사용해도 할 수 없습니다! 나는 많은 예제를 사용했지만 아무도 효과가 없었습니다!애니메이션이있는 WindowManager (가능합니까?)
public BannerLayout(Activity activity, final Context context) {
super(context);
this.context = context;
final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
PixelFormat.TRANSLUCENT);
wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.popupLayout = (RelativeLayout) inflater.inflate(R.layout.popup_activity, null);
this.popupLayout.setVisibility(GONE);
this.setActive(false);
wm.addView(this.popupLayout, params);
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
private void show(){
Animation in = AnimationUtils.loadAnimation(this.context, android.R.anim.fade_in);
this.popupLayout.setAnimation(in);
this.setActive(true);
this.popupLayout.setVisibility(VISIBLE);
}
sandrstar ... 완벽하게 작동했습니다! 그러나 ... 이러한 구성 요소로 애니메이션 번역을 사용할 수 있는지 궁금합니다. I가이 구성 요소가 화면 아래로 효과를 만들기 위해 ... – LeandroPortnoy
개인 무효 쇼()가 필요합니다 { \t \t \t \t // 애니메이션 fadeIn = (애니메이션) AnimationUtils.loadAnimation (는 getContext(), android.R. anim.fade_in); \t \t // this.startAnimation(fadeIn); \t //this.bannerRelativeLayout.setVisibility(VISIBLE); \t \t \t \t this.setActive (true); mPopupLayout.setVisibility (VISIBLE); \t \t Final Animation in = new TranslateAnimation (0, 0, -1000, 0); in.setDuration (700); AnimationSet animation = 새 AnimationSet (거짓); animation.addAnimation (입력); \t mPopupLayout.startAnimation (animation); \t} – LeandroPortnoy
죄송합니다. 나는 그것을 시도하고 잘 작동하는 것 같습니다. params.width = ViewGroup.LayoutParams.MATCH_PARENT;를 사용해야 할 수도 있습니다. params.height = ViewGroup.LayoutParams.MATCH_PARENT; FrameLayout의 경우. – sandrstar