当前位置:网站首页>图片旋转移动缩放渐变
图片旋转移动缩放渐变
2022-06-24 20:17:00 【我与c语言不共戴天】
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="yidong" android:text="移动"/> <Button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="suofang" android:text="缩放"/> <Button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="xuanzhuang" android:text="旋转"/> <Button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="jianbian" android:text="渐变"/> </LinearLayout> <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="10dp" android:src="@drawable/ab" /> </LinearLayout> java package com.commerce.my; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; public class MainActivity extends AppCompatActivity { ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imageView =findViewById(R.id.imageView); } public void yidong(View view) { Animation translate= AnimationUtils.loadAnimation(this,R.anim.translate_animation); imageView.startAnimation(translate); } public void suofang(View view) { Animation scale= AnimationUtils.loadAnimation(this,R.anim.scale_animation); imageView.startAnimation(scale); } public void xuanzhuang(View view) { Animation rotate= AnimationUtils.loadAnimation(this,R.anim.rotate_animation); imageView.startAnimation(rotate); } public void jianbian(View view) { Animation alpha= AnimationUtils.loadAnimation(this,R.anim.alpha_animation); imageView.startAnimation(alpha); } } 平移 <?xml version="1.0" encoding="utf-8" ?><translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:fromXDelta="0" android:fromYDelta="0" android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:toXDelta="100" android:toYDelta="300"> </translate> 缩放 <?xml version="1.0" encoding="utf-8" ?><scale xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:fromXScale="0.5" android:fromYScale="0.5" android:interpolator="@android:anim/accelerate_interpolator" android:pivotX="50%" android:pivotY="50%" android:toXScale="2.0" android:toYScale="2.0" > </scale> 旋转 <?xml version="1.0" encoding="utf-8" ?><rotate xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:fromDegrees="0" android:toDegrees="360" android:pivotX="50%" android:pivotY="50%" android:repeatCount="1" android:repeatMode="reverse" android:duration="1000" > </rotate> 渐变 <?xml version="1.0" encoding="utf-8" ?><alpha xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1000" android:fromAlpha="1.0" android:repeatMode="reverse" android:repeatCount="infinite" android:interpolator="@android:anim/linear_interpolator" android:toAlpha="0.0" />
边栏推荐
- Punch smart spirit 1. The brand is attractive. What is the strength of the product?
- Preliminary understanding of qtoolbutton
- The picture of wechat official account can not be displayed normally
- JMeter socket connection sends data
- Paint rounded rectangle
- Scala adapter pattern
- 2021-11-05
- 【Redis实现秒杀业务③】超卖问题之乐观锁具体实现
- Mobile security tool apktool
- EVM Brief
猜你喜欢

The basic principle and application of iterator and enhanced for

Single blind box removal, social blind box and friend blind box program source code

Apk decompiled method (not confused)

Tiktok wallpaper applet, starlight wallpaper applet version 2.0, upgraded version

Text editor for QT project practice -- Episode 9

Punch smart spirit 1. The brand is attractive. What is the strength of the product?
![[microservices sentinel] sentinel quick start | building an image | starting the console](/img/88/a01c8120f6117f1b8e4463cf6f685f.png)
[microservices sentinel] sentinel quick start | building an image | starting the console

Custom animation (simulated win10 loading animation)

ServerSocket and socket connection

【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
随机推荐
Custom control - round dot progress bar (imitating one key acceleration in security guard)
移动安全工具-apktool
Text editor of QT project practice ---------- episode 11
2021-04-18
Leetcode 1248. Statistics of "graceful subarray" (harm, suddenly found that it can only enumerate violently)
A website for programmers with a monthly salary of 30K
QT (35) - operate excel qxlsx qaxobject
[redis realizes seckill service ④] one order for one person, and cannot be purchased repeatedly
Single blind box removal, social blind box and friend blind box program source code
2022安全员-C证考试模拟100题及在线模拟考试
Thermodynamic diagram display correlation matrix
EVM Brief
Simulation questions and answers of the latest national fire facility operator (senior fire facility operator) in 2022
[microservices sentinel] cluster link | microservices cluster environment construction
【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
EVM简略
Mobile security tool jar
A plug-in framework for implementing registration free and login verification with hook technology
Xcode preview displays a bug in the content of the list view and its solution
Tiktok wallpaper applet, starlight wallpaper applet version 2.0, upgraded version