本网页所有文字内容由 imapbox邮箱云存储,邮箱网盘, iurlBox网页地址收藏管理器 下载并得到。
ImapBox 邮箱网盘 工具地址: https://www.imapbox.com/download/ImapBox.5.5.1_Build20141205_CHS_Bit32.exe
PC6下载站地址:PC6下载站分流下载
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox 网页视频 工具地址: https://www.imapbox.com/download/ImovieBox4.7.0_Build20141115_CHS.exe
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
实现两张图片渐隐渐现的过渡效果Transition Drawable实现两张图片之间动态过度效果的方式。 运行如下所示:第一张为初始界面,第二张为过度中界面,第三张为过渡结束 新建一个TransitionDrawable的Android工程。 主界面activity_main.xml代码如下: 主界面主要是一个应用了TransitionDrawable的按钮
strings.xml代码如下:
colors.xml代码如下:
MainActivity.java代码如下
扩展阅读: https://www.tuicool.com/articles/uiaYBrU https://adk.tumblr.com/post/13069401302/outofmemoryerror-imageview-and-transitiondrawable
目录结构:<RelativeLayout xmlns:android="https://schemas.android.com/apk/res/android" xmlns:tools="https://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/button_text" android:layout_centerInParent="true" android:onClick="change" android:background="@drawable/transition" android:layout_marginBottom="20dp"/> </RelativeLayout>
transition是在drawalbe文件夹下,其代码如下所示: <?xml version="1.0" encoding="utf-8"?> <transition xmlns:android="https://schemas.android.com/apk/res/android"> <item android:drawable="@color/red"></item> <item android:drawable="@color/green"></item> </transition>
<string name="app_name">TransitionDrawable</string> <string name="hello_world">Hello world!</string> <string name="action_settings">Settings</string> <string name="button_text">过渡效果</string>
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#ff0000</color> <color name="green">#00ff00</color> </resources>
package com.shen.transitiondrawable; import android.app.Activity; import android.graphics.drawable.TransitionDrawable; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } public void change(View v) { TransitionDrawable drawable = (TransitionDrawable)((Button)v).getBackground(); drawable.startTransition(2000); } }
阅读和此文章类似的: 程序员专区