当前位置:网站首页>图片旋转移动缩放渐变
图片旋转移动缩放渐变
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" />
边栏推荐
- 2022 simulated 100 questions of safety officer-c certificate examination and online simulated examination
- The basic principle and application of iterator and enhanced for
- 大厂高频软件测试面试题和答案都帮你准备好啦,备战金九银十
- Paint rounded rectangle
- Working principle analysis of kubernetes architecture core components
- ros(25):rqt_ image_ View reports an error unable to load plugin for transport 'compressed', error string
- JSON file of China's provincial boundaries
- Rich text tables, lists, pictures
- 2022r1 quick opening pressure vessel operation test questions and answers
- QT (36) -rapidjson parsing nested JSON
猜你喜欢

Mobile security tool jar

Custom animation (simulated win10 loading animation)

Use of navigation and navigationui

Use coordinatorlayout+appbarlayout+collapsingtoolbarlayout to create a collapsed status bar

Decoupling pages and components using lifecycle

百公里加速仅5.92秒,威兰达高性能版以高能产品实力领跑

Working principle analysis of kubernetes architecture core components

QT(35)-操作EXCEL-QXlsx-QAxObject

2022年全国最新消防设施操作员(高级消防设施操作员)模拟题及答案

Simulation questions and answers of the latest national fire facility operator (senior fire facility operator) in 2022
随机推荐
Qiniu cloud uploads video to get the first frame of video
Hot fix sophix multi-channel patch solution
I brush the question I - copy the linked list with random pointer
通过kubernetes可视化界面(rancher)安装kibana
ros(25):rqt_image_view报错Unable to load plugin for transport ‘compressed‘, error string
Practical operation notes - notebook plus memory and ash cleaning
Thingsboard - rest API obtains and refreshes tokens
The acceleration of 100 km is only 5.92 seconds, and the willanda high-performance version leads with the strength of high-energy products
Mobile security tool jarsigner
Scala sample object
ServerSocket and socket connection
Binder mechanism and Aidl communication example
The picture of wechat official account can not be displayed normally
Custom control - round dot progress bar (imitating one key acceleration in security guard)
JSON file of China's provincial boundaries
Only positive integers can be entered in the text box
Tiktok wallpaper applet v1.0.2 function, new arrival function
Text editor of QT project practice ---------- episode 8
Text editor for QT project practice -- Episode 9
I'd like to ask how to open an account at industrial securities? Is it safe to open a stock account through the link