代码

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:orientation="vertical" android:layout_width="fill_parent"
 4     android:background="@drawable/fa" android:id="@+id/ll_product_details"
 5     android:layout_height="fill_parent">
 6     <LinearLayout android:id="@+id/ll_topBar"
 7         android:background="#000000" android:layout_width="fill_parent"
 8         android:layout_height="wrap_content">
 9         <Button android:text="bb" android:id="@+id/btn_Back"
10             android:layout_marginBottom="4dip" android:layout_width="wrap_content"
11             android:layout_height="wrap_content" />
12         <TextView android:text="Seventeen       " android:id="@+id/TextView01"
13             android:layout_weight="1.0" android:textColor="#FFFFFF"
14             android:gravity="center_vertical|center_horizontal" android:textSize="30dip"
15             android:layout_width="fill_parent" android:layout_height="fill_parent" />
16     </LinearLayout>
17     <LinearLayout android:layout_width="fill_parent"
18         android:id="@+id/ll_ttlt" android:background="#A4A4A4"
19         android:layout_height="wrap_content">
20         <TextView android:text="TextView02" android:id="@+id/tv"
21             android:layout_marginLeft="5dip" android:textColor="#FFFFFF"
22             android:textSize="16dip" android:layout_width="wrap_content"
23             android:layout_weight="1.0" android:layout_height="wrap_content" />
24         <TextView android:text="TextView03" android:id="@+id/TextView02"
25             android:layout_marginLeft="5dip" android:layout_marginRight="4dip"
26             android:textSize="16dip" android:layout_width="wrap_content"
27             android:textColor="#FFFFFF" android:layout_height="wrap_content" />
28         <ImageView android:id="@+id/ImageView01" android:background="@drawable/btn_drop_down"
29             android:layout_marginRight="4dip" android:layout_width="wrap_content"
30             android:layout_height="wrap_content" />
31     </LinearLayout>
32     <ViewAnimator android:layout_width="fill_parent"
33         android:visibility="gone" android:id="@+id/detail_layout"
34         android:background="#A4A4A4" android:layout_height="180dip">
35         <TextView android:text="TextView02" android:id="@+id/tvggg"
36             android:layout_marginLeft="5dip" android:textColor="#FFFFFF"
37             android:textSize="16dip" android:layout_width="wrap_content"
38             android:layout_weight="1.0" android:layout_height="wrap_content" />
39         <TextView android:text="TextView03" android:id="@+id/TextVfdf"
40             android:layout_marginLeft="5dip" android:layout_marginRight="4dip"
41             android:textSize="16dip" android:layout_width="wrap_content"
42             android:textColor="#FFFFFF" android:layout_height="wrap_content" />
43         <ImageView android:id="@+id/Imaff" android:background="@drawable/btn_drop_down"
44             android:layout_marginRight="4dip" android:layout_width="wrap_content"
45             android:layout_height="wrap_content" />
46     </ViewAnimator>
47     <ImageView android:id="@+id/iv_hand" android:background="@drawable/hand"
48         android:layout_marginTop="15dip" android:layout_width="wrap_content"
49         android:layout_marginLeft="15dip" android:layout_height="wrap_content" />
50     <LinearLayout android:orientation="horizontal"
51         android:layout_marginTop="310dip" android:background="#A4A4A4"
52         android:id="@+id/ll_btn_bom" android:layout_width="fill_parent"
53         android:layout_height="wrap_content">
54         <Button android:text="previous" android:id="@+id/btn_Previous"
55             android:layout_weight="1.0" android:layout_marginTop="3dip"
56             android:layout_width="wrap_content" android:layout_height="wrap_content" />
57         <Button android:text="   Share   " android:id="@+id/btn_Share"
58             android:layout_weight="1.0" android:layout_marginTop="3dip"
59             android:layout_width="wrap_content" android:layout_height="wrap_content" />
60         <Button android:text=" Find it " android:id="@+id/btn_Find_it"
61             android:layout_weight="1.0" android:layout_marginTop="3dip"
62             android:layout_width="wrap_content" android:layout_height="wrap_content" />
63         <Button android:text="   Next   " android:id="@+id/btn_Next"
64             android:layout_weight="1.0" android:layout_marginTop="3dip"
65             android:layout_width="wrap_content" android:layout_height="wrap_content" />
66     </LinearLayout>
67 </LinearLayout>
68 push_up_in.xml
代码

1 <?xml version="1.0" encoding="UTF-8"?>
2 <set xmlns:android="http://schemas.android.com/apk/res/android">
3     <translate android:fromYDelta="0" android:toYDelta="100%p" android:duration="800"/>
4     <alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="800" />
5 </set>

push_up_out.xml
代码

1 <?xml version="1.0" encoding="utf-8"?>
2 <set xmlns:android="http://schemas.android.com/apk/res/android">
3     <translate android:fromYDelta="100%p" android:toYDelta="0" android:duration="100"/>
4     <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="100" />
5 </set>

TestAAA.class

代码

 1 package com.test;
 2 
 3 import android.app.Activity;
 4 import android.os.Bundle;
 5 import android.view.View;
 6 import android.view.View.OnClickListener;
 7 import android.view.animation.AnimationUtils;
 8 import android.widget.ImageView;
 9 import android.widget.ViewAnimator;
10 
11 public class TestAAA extends Activity {
12     private ViewAnimator va_detail;
13     private ImageView iv111;
14     private boolean ff = false;
15 
16     @Override
17     public void onCreate(Bundle savedInstanceState) {
18         super.onCreate(savedInstanceState);
19 
20         setContentView(R.layout.product_details);
21         va_detail = (ViewAnimator) findViewById(R.id.detail_layout);
22         iv111 = (ImageView) findViewById(R.id.ImageView01);
23         iv111.setOnClickListener(new OnClickListener() {
24 
25             @Override
26             public void onClick(View v) {
27                 if (!ff) {
28                     showDetail();
29                     ff = true;
30                 } else {
31                     closeDetail();
32                     ff = false;
33                 }
34             }
35         });
36     }
37 
38     private void showDetail() {
39         if (!va_detail.isShown()) {
40             va_detail.setAnimation(AnimationUtils.loadAnimation(this,
41                     R.anim.push_up_in));
42         }
43         va_detail.setVisibility(View.VISIBLE);
44     }
45 
46     private void closeDetail() {
47         if (va_detail.isShown()) {
48             va_detail.setAnimation(AnimationUtils.loadAnimation(this,
49                     R.anim.push_up_out));
50         }
51         va_detail.setVisibility(View.GONE);
52     }
53 }
54 

转载于:https://www.cnblogs.com/qwhg/archive/2010/05/20/1740375.html

弹出VIEW.非dialog相关推荐

  1. oc 经常用到弹出view的方法

    #pragma mark 弹出view -(void)exChangeOut:(UIView *)changeOutView dur:(CFTimeInterval)dur { CAKeyframeA ...

  2. Acitivity(页面)之间的跳转,ProgressBar 进度条,PopupWindow 弹出框,Dialog 对话框,Spinner下拉框

    Acitivity(页面)之间的跳转 Acitivity(页面)之间的跳转需要使用到 Intent(意图) Intent intent = new Intent(MainActivity.this(从 ...

  3. Swift 仿简书、淘宝App的弹出view效果

    感谢原作者提供OC代码 个人博客主站:欢迎访问http://littlesummerboy.com 先来张图让小伙伴们看一眼 主要有四个View 黑色 XtPopViewController的self ...

  4. Android屏幕随机位置弹出View

    最近项目中人脸注册需要尽量多的捕捉人脸特征,就要想办法使得人脸在注册中呈现不同角度,于是想到在屏幕内随机位置弹出一个吸引注意力的View. 本文中主要用到: 1.view.setX();setY()方 ...

  5. 安卓开发之简单的弹出单选菜单Dialog

    Android开发笔记: final String[] items3 = new String[]{"条目1", "条目2", "条目3", ...

  6. 安卓Dialog弹出对话框全解:包含了AlertDialog,DialogFragment

    全栈工程师开发手册 (作者:栾鹏) 安卓教程全解 Dialog基类中并没有定义界面,所以如果使用dialog类设置弹出框,需要使用xml自定义UI. 当然系统也自带了几个dialog派生的弹出框,例如 ...

  7. Dialog弹出对话框使用

    文章目录 前言 一.对话框 1.自定义dialog样式 1.dialog_delect.xml 2.shape_dialog.xml 3.styles.xml 2.使用显示对话框的方法 总结 前言 自 ...

  8. android dialog隐藏虚拟按键,关于此框架在BottomSheetDialogFragment使用时,华为手机底部虚拟按键弹出与隐藏时输入框位置不贴键盘...

    我这边试过还是不行,而且我们ui是要dialog不全屏的,下面附上代码 public void onStart() { super.onStart(); Dialog dialog = getDial ...

  9. 不用悬浮窗权限弹出全局dialog的解决方法

    如何在application弹出一个全局的dialog? 思路一: 直接在application new dialog执行show方法. 问题,直接在application或服务中new dialog ...

最新文章

  1. suprahex画进化树_安装使用pyclone进行克隆演化推断
  2. 开了gomod不识别gopath_三分钟掌握Go mod常用与高级操作
  3. 如何处理SAP Launchpad上tile打不开的问题
  4. git 提交文件_GIT不小心提交了大文件导致提交失败怎么办?
  5. 大数据与大量数据处理_我们如何处理和使用如此大量的数据?
  6. sqlite排序规则
  7. python——周边
  8. python3爬虫 - cookie登录实战
  9. c语言i=5.6a=(int)i,(PSIM仿真)从零开始设计BOOST数字控制器
  10. 1 统计学习方法基础
  11. XC1004四轴SPI运动控制芯片,bc014四轴电子凸轮运动控制模块
  12. mac 安装pip教程
  13. 2021 编程语言排行榜
  14. 虚拟服务器 切换任务管理器,在远程桌面连接中使用任务管理器(转)
  15. linux 6.7 远程端口,CentOS6.7安装vncserver及xrdp实现远程桌面
  16. 微信小程序时间标签和时间范围的联动
  17. H5/C3进阶(9) -- 元素的显示与隐藏
  18. OFFICE技术讲座:设置调整字间距(kern/kerning)后,标点就不压缩
  19. Codeforces Round #577 (Div. 2)--B. Zero Array
  20. 企业变革与创新 | 如何打造创新”永动机“?

热门文章

  1. c语言用指针实现打开和关闭文件,我用rewind函数没把指针直到开始,关闭文件然后打开就行。帮忙看看...
  2. hadooppythonsql_半小时搞定Hadoop+Mysql+Hive+Python
  3. c语言条件语句示例_PHP中的条件语句和示例
  4. 数据库系统数据库管理系统_数据库管理系统介绍
  5. JavaScript中的String substring()方法和示例
  6. 考研C++必刷题(一)
  7. android 服务端 漏洞,安卓漏洞 CVE 2017-13287 复现详解-
  8. linux如何停用xdmcp服务,如何禁用XDMCP服务
  9. UVA-136:Ugly Numbers
  10. 哈夫曼算法证明+哈夫曼编码译码程序实现