当前位置:网站首页>图片旋转移动缩放渐变
图片旋转移动缩放渐变
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" />
边栏推荐
- [redis realizes seckill business ③] specific implementation of optimistic lock for oversold problem
- Text editor for QT project practice - Episode 10
- Meta & Berkeley proposed a universal multi-scale visual transformer based on pooled self attention mechanism. The classification accuracy in Imagenet reached 88.8%! Open source
- 108 pages (40000 words) proposal for future apartment intelligent design platform project (version 2022)
- ros(24):error: invalid initialization of reference of type ‘xx’ from expression of type ‘xx’
- EVM Brief
- ros(24):error: invalid initialization of reference of type ‘xx’ from expression of type ‘xx’
- I brush the question I - copy the linked list with random pointer
- Realization of MNIST handwritten numeral recognition
- Use of JMeter
猜你喜欢

Binder mechanism and Aidl communication example

2022年全国最新消防设施操作员(高级消防设施操作员)模拟题及答案
![[microservices sentinel] cluster link | microservices cluster environment construction](/img/75/3cc6abf1e72d651b082415db9db46c.png)
[microservices sentinel] cluster link | microservices cluster environment construction

If the order has not been paid for 30 minutes, it will be automatically cancelled. How can I achieve this?

Applet opening traffic master

QT (35) - operate excel qxlsx qaxobject

Use of file class filenamefilter & filefilter in io

Text border format and text block of rich text

Punch smart spirit 1. The brand is attractive. What is the strength of the product?

Wallpaper applet wechat applet
随机推荐
Input series
【Redis实现秒杀业务②】超卖问题的解决方案
[micro service sentinel] real time monitoring | RT | throughput | concurrency | QPS
【Redis实现秒杀业务③】超卖问题之乐观锁具体实现
Go语言运算符(第8课下)
Usage of ViewModel and livedata in jetpack
How to reduce the font size of custom controls (optimize the round dot progress bar)
Add information on the left and add parts on the right of the status bar
【Redis实现秒杀业务④】一人一单,不可重复购买
断言(assert)的用法
Activity startup process
【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
adb shell sendevent
iNFTnews | 国内NFT发展仅限于数字藏品吗?
The problem of multiple callback of video ads stimulated by applets (offcolse problem)
Scala trait exercise
Text editor for QT project practice - Episode 12
移动安全工具-dex2jar
Registration method of native method in JNI
C# 闭包的垃圾回收