android環形進度
⑴ 電腦WIN10系統打字中文人途中自己變為英文該如何操作
輸入法不兼容吧,換輸入法,你用win10自帶的拼音或五筆試試有沒有這情況就知道了。
⑵ 求教 android半圓弧形的進度條問題
package com.example.comt;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.RectF;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.view.View;
public class CircleView extends View {
Paint paint,textpaint;
RectF area;
int value = 100;
LinearGradient shader;
public CircleView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
// TODO Auto-generated constructor stub
}
public CircleView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
// TODO Auto-generated constructor stub
}
public CircleView(Context context) {
super(context);
init();
// TODO Auto-generated constructor stub
}
public void setProgress(int value){
this.value = value;
invalidate();
}
public void init() {
paint = new Paint();
paint.setStrokeWidth(50f);
paint.setColor(Color.WHITE);
paint.setStyle(Style.STROKE);
paint.setAntiAlias(true);
textpaint = new Paint();
textpaint.setTextSize(50f);
textpaint.setColor(Color.WHITE);
area = new RectF(100, 100, 500, 500);
shader =new LinearGradient(0, 0, 400, 0, new int[] {
Color.BLUE, Color.WHITE}, null,
Shader.TileMode.CLAMP);
paint.setShader(shader);
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
canvas.drawColor(Color.GRAY);
canvas.drawArc(area, 120, 360*value/100 , false, paint);
canvas.drawText(value+"%", 270, 290, textpaint);
}
}
看下是不是你想要的,調用setprogress()既可調節圓環
⑶ android自定義環形進度條怎麼自由控制進度條的消失與隱藏
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bluetoothmeter);
mhandler = new Handler();
//通過mSearcheHandler更新UI
mSearchHandler=new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if(msg.what==0){
//改變環形進度條的進度
mCircleProcessBar.setProgress(mcnt);
mcnt+=1;
if(MCNT_MAX<=mcnt){
mCircleProcessBar.setVisibility(View.GONE);
}
}
}
};
mBlueService = BluetoothLeService.getInstance();
initView();
initEvent();
}
private void initEvent()
{
mImgBtnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//搜索
mbtnSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Prepare list view and initiate scanning
if (m_devicelistadapter != null) {
m_devicelistadapter.clear();
m_devicelistadapter.notifyDataSetChanged();
}
startScan();
//設置圓環進度條的出現時間(秒)
new TimerDelay(mSearchHandler).setDelayTime(CIRCLE_APPARE_TIME,mCircleProcessBar);
mcnt=1;
}
});
}