zoukankan      html  css  js  c++  java
  • popUpWindow 动画无法超出窗体的解决方案

    popupWindow 做动画时,当要求有一个放大动画时,动画无法超出窗体,给人的感觉是只有内容在放大,窗体不动。

    这是由于窗口大小固定的原因,解决方案是加大popUpwindow的 大小。

    一个比较省事儿的方案是,直接把popupwindow窗体设为全屏和透明。这样你就可以任意玩了。这种方案的缺点是 弹窗的位置无法用自带的方法设置。

    另外点击窗口外弹窗消失也没法实现了。所以最好的解决方案是,弹窗的大小稍微大于view的大小。

    目前的处理办法是,在做popview布局时在外面套一个空布局,然后在内层布局中设置一定的margin值。这样也不会屏蔽掉点击外部退出弹窗的效果。代码如下:

    <?xml version="1.0" encoding="utf-8"?>
    //套一个空布局
    <com.zhy.autolayout.AutoRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        >
        <com.zhy.autolayout.AutoLinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="10dp"//设置margin值,由于我的效果是贴着右上角弹出来,所以右面和上面margin值设置小一点,或者不设置(紧贴)
            android:layout_marginRight="2dp"
            android:layout_marginTop="2dp"
            android:background="@drawable/pop_bg_shape"
            android:orientation="vertical">
            <TextView
                android:id="@+id/tv_createFolder"
                android:layout_width="224px"
                android:layout_height="68px"
                android:gravity="center"
                android:text="新建文件夹"
                android:textColor="@color/button_textColor"
                android:textSize="24px" />
  • 相关阅读:
    Windows下使用CMake编译SuiteSparse成VS工程
    【设计模式
    【设计模式
    vue过滤和复杂过滤
    el-tooltip 自定义样式
    el-table加表单验证
    使用Go env命令设置Go的环境
    面试官:GET 和 POST 两种基本请求方法有什么区别?
    解决 Vue 重复点击相同路由报错的问题
    利用promise和装饰器封装一个缓存api请求的装饰器工具
  • 原文地址:https://www.cnblogs.com/epmouse/p/5726722.html
Copyright © 2011-2022 走看看