seekbar

Set SeekBar's progress color to transparent

眉间皱痕 提交于 2020-02-03 03:25:12
问题 Here is a picture of what I want to accomplish, where there is no progress color (transparent), with a solid grey background bar: I tried android:progressTint="#00000000" But that sets the whole bar (progress bar AND the back bar) to transparent. I also tried: android:progressDrawable="@drawable/customseekbar" where customseekbar.xml: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android

Android:UI界面设计基础知识总结(二)

我的未来我决定 提交于 2020-01-31 17:16:57
一、ProgressBar(进度条) 进度条有两种形式,圆形加载式和水平长条形状,可通过style属性设置(注意:前面没有android:) 列举几种:   ?android:attr/progressBarStyleHorizontal    细水平长度进度条   ?android:attr/progressBarStyleSmall      旋转画面的小圆形进度条   ?android:attr/progressBarStyleLarge      旋转画面的大圆形进度条   @android:style/Widget.ProgressBar.Horizontal  粗水平长度进度条   @android:style/Widget.ProgressBar.Small    旋转画面的小圆形进度条   @android:style/Widget.ProgressBar.Large    旋转画面的大圆形进度条 android:max="100"      该属性设置进程的最大值 android:progress="50"   表示初始的进程值 实现动态进度条步骤: 创建线程,判断耗时操作是否完成,若没有完成,调用进度条的setProgress()方法更新进度,然后循环操作,直到耗时操作完成,然后调用setVisibility()方法设置进度条不显示。 <!--

Android--进度条

痞子三分冷 提交于 2020-01-28 02:22:47
ProgressBar//进度条 默认是圆形的进度条 ProgressBar void setProgress(int Progress):设置当前进度 int getProgress():得到当前进度 void setMax(int max):设置最大进度 int getMax():设置或得到最大进度 View void setVisibility(int visibility):设置视图的可见性 View.VISIBLE:标识可见 View.INVISIBLE:标识不可见,但占屏幕空间 View.GONE:表示不可见,也不占屏幕空间 SeekBar:可手动滑动的进度条: setOnSeekBarChangeListener(OnSeekBarChangeListenter l):设置改变的监听 OnseekBarChangeListener: onProgressChanged(SeekBar seekBar,int progress,boolean fromUser):改变进度 onStartTrackingTouth():按下滑杆 onStopTrackingTouth(SeekBar seekBar):从滑杆离开 xml代码: < LinearLayout android: layout_width = " match_parent " android: layout

Android基础——高级UI组件

左心房为你撑大大i 提交于 2020-01-24 20:09:38
进度条:ProgressBar 拖动条:SeekBar 星级条:RatingBar <?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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" tools:context=".MainActivity"> <ProgressBar android:id="@+id/progressBar1" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50"> </ProgressBar> <ProgressBar

How to change Android SeekBar track start position?

心不动则不痛 提交于 2020-01-23 04:53:35
问题 I'd like to set the SeekBars 's track start position so it does not start from the left side of the seekbar, but form an arbitrary position. Here is a photoshop image how it should look like: http://i.imgur.com/QCMEu.png It should be just a graphical effect, the SeekBar 's underlying logic is not changed. I tried to change the Seekbar.getprogressDrawable.SetBounds() to change the track image position, but no luck. 回答1: add this proprety android:progress="2" 回答2: You can set progress of

How to change Android SeekBar track start position?

半腔热情 提交于 2020-01-23 04:53:08
问题 I'd like to set the SeekBars 's track start position so it does not start from the left side of the seekbar, but form an arbitrary position. Here is a photoshop image how it should look like: http://i.imgur.com/QCMEu.png It should be just a graphical effect, the SeekBar 's underlying logic is not changed. I tried to change the Seekbar.getprogressDrawable.SetBounds() to change the track image position, but no luck. 回答1: add this proprety android:progress="2" 回答2: You can set progress of

Android Audio SeekBar

China☆狼群 提交于 2020-01-21 03:16:05
问题 I'm trying to create something where a single audio file is played and can be paused and manipulated with a progress/seek bar. I want to have an image taking up most of the screen and then a play pause button on the bottom left and the bar to the right of the button. Everything works the seekbar which isn't link to the audio. My progress bar coding is a probably a mess because if taken it from several i've seen on the internet but they are mostly confusing for me as they are for music player

想到啥写啥第一期:Android的MediaPlayer和VideoView简单使用

夙愿已清 提交于 2020-01-20 21:18:46
想到啥写啥第一期:致力于更简单易懂的代码解决我们安卓小白遇到的问题 今天就写音频播放和视频播放吧,是MediaPlayer,VideoView的知识点 1.用Mediaplayer播放音频,用seekBar去监听,然后就是手机播放器差不多的效果,难看是难看了点,然后什么播放暂停按钮可以自己添加哈! 上代码 .xml < TextView android : id = "@+id/start" android : layout_width = "80sp" android : text = "00:00" android : gravity = "center" android : textSize = "20sp" android : layout_height = "50sp" / > < SeekBar android : id = "@+id/seekBar" android : layout_width = "220sp" android : layout_height = "50sp" / > < TextView android : id = "@+id/end" android : text = "00:00" android : gravity = "center" android : textSize = "20sp" android : layout_width

Android布局属性与常用控件

守給你的承諾、 提交于 2020-01-20 20:47:33
一、Android常用布局属性 1. LinearLayout的特有属性 android:orientation:设置布局排列方式 android:layout_weight:设置所占布局的权重 android:weightSum:设置最大权重和 2. RelativeLayout的特有属性 属性值为“true”或“false” android:layout_centerHrizontal:位于父控件的横向中间位置 android:layout_centerVertical:位于父控件的纵向中间位置 android:layout_centerInparent:位于父控件的纵横向中间位置 android:layout_alignParentBottom:贴紧父元素的下边缘 android:layout_alignParentLeft:贴紧父元素的左边缘 android:layout_alignParentRight:贴紧父元素的右边缘 android:layout_alignParentTop:贴紧父元素的上边缘 android:layout_alignParentStart:将控件开始位置与父控件的开始位置对齐 android:layout_alignParentEnd:将控件结束位置与父控件的结束位置对齐 属性值为引用“id” android:layout_below

seekBar拖动滑块

断了今生、忘了曾经 提交于 2020-01-20 11:25:57
中秋节学习,, 通过拖动滑块,改变图片的透明度 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/image" android:layout_width="match_parent" android:layout_height="240dp" android:src="@drawable/lijiang"/> <!-- 定义一个拖动条,并改变它的滑块外观 --> <SeekBar android:id="@+id/seekbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="255" android:progress="255" android:thumb="@mipmap/ic_launcher"/> <