Android 进度条改变图片透明度
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.administrator.jsq.MainActivity"
android:orientation="vertical">
<!--图片透明-->
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="250"
android:progress="0"
android:id="@+id/sar"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/f8"
android:id="@+id/tp"
/>
</LinearLayout>
package com.example.administrator.jsq; import android.media.Image;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.SeekBar; public class MainActivity extends AppCompatActivity {
SeekBar sar;
ImageView tp; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sar = (SeekBar)findViewById(R.id.sar);
tp = (ImageView)findViewById(R.id.tp);
tp.setImageAlpha(0);
sar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
tp.setImageAlpha(progress);
} @Override
public void onStartTrackingTouch(SeekBar seekBar) {
Log.e("TAG", "进度条开始拖动");
} @Override
public void onStopTrackingTouch(SeekBar seekBar) {
Log.e("TAG","进度条停止拖动");
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.administrator.jsq"> <application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application> </manifest>
Android 进度条改变图片透明度的更多相关文章
- Android课程---用进度条改变图片透明度
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
- Android实现拖动进度条改变图片透明度
layout文件: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:an ...
- Android——进度条控制图片透明度
xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= ...
- Android中使用SeekBar拖动条实现改变图片透明度
场景 效果 注: 博客: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书.教程推送与免费下载. 实现 将布局改为Lin ...
- 多种的android进度条的特效源码
多种的android进度条的特效源码,这个源码是在源码天堂那个网站上转载过来的,我已经修改一部分了,感觉很实用的,大家可以学习一下吧,我就不上传源码了,大家可以直接到那个网站上下载吧. 源码天堂下载地 ...
- android进度条
android进度条 1.达到的效果 2.布局代码 先写一个my_browser.xml文件 存放WebView <?xml version="1.0" encoding=& ...
- 函数传参,改变Div任意属性的值&&图片列表:鼠标移入/移出改变图片透明度
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Android 进度条(ProgressBar)和拖动条(Seekbar)补充“自定义组件”(总结)
这周结束了,我也码了一周的字,感觉还是很有种脚踏实地的感觉的,有时间就可以看看自己的总结再查漏补缺,一步一个脚印,做出自己最理想的项目. 今天我们讲两点: 1.ProgressBar: 其实前面也稍微 ...
- Android 进度条
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
随机推荐
- 为什么在我眼里你是一只傻逼——傻逼“常所用”句型之(2)——“当当网的就有XXX人评论,YYY%的推荐”
A:这东西里面尽是大粪. B:这东西当当网的就有325人评论,98.8%的推荐.京东的整体评论是五星,37人评价,31人给好评,1人差评,5人中评:亚马逊有6条好评,1条中评. http://news ...
- ASP.NET 中通过Form身份验证 来模拟Windows 域服务身份验证的方法
This step-by-step article demonstrates how an ASP.NET application can use Forms authentication to ...
- 怎样查出SQLServer的性能瓶颈
怎样查出SQLServer的性能瓶颈 --王成辉翻译整理,转贴请注明出自微软BI开拓者[url]www.windbi.com[/url]--原帖地址 如果你曾经做了很长时间的DBA,那么你会了解到SQ ...
- TortoiseSVN,排除不想提交文件的方法(转)
转自:tortoisesvnsubversionfilebuilddialoglist 下面是英文帮助: 利用TortoiseSVN的修改列表 功能可以实现,在新版本中TortoiseSVN特地预置了 ...
- linux下串口控制
/* 本程序符合GPL条约 * Beneboy 2003-5-16 */ #include <stdio.h> // printf #include < ...
- spring Aop的一个demo
面向切面是什么我就不说了. 上代码: package com.foreveross.service.weixin.test; import java.lang.annotation.Documente ...
- armv8(aarch64)linux内核中flush_dcache_all函数详细分析【转】
转自:http://blog.csdn.net/qianlong4526888/article/details/12062809 版权声明:本文为博主原创文章,未经博主允许不得转载. /* * __ ...
- Java可变长参数方法调用问题
不说废话,直接上代码: package mytest; import java.util.List; public class TestClass { public void method(List& ...
- ACM第二站————归并排序
转载请注明出处,谢谢!http://www.cnblogs.com/Asimple/p/5459664.html 归并排序————二分的思想 以中间的数为基准,每次排序都将比其小[升序排](大[降序排 ...
- 【转】MYSQL入门学习之九:索引的简单操作
转载地址:http://www.2cto.com/database/201212/176772.html 一.创建索引 www.2cto.com MYSQL常用的索引类型主要有以 ...