여러 개의 세로 탐색 모음이있는보기가 있습니다. 엄지 손가락으로 텍스트를 그리는 중이며 진행 상황이 변경되는 동안 엄지 손가락 위에 떠 다니는 텍스트 상자를 표시하고 싶습니다.세로 Seekbar 플로팅 텍스트 문제
진행 상황이 변경되는 동안 떠 다니는 엄지 손가락 위에 텍스트를 표시 할 수 있습니다. OnStopTracking/엄지 부동 텍스트에서 손가락을 떼어 내면 안보이게됩니다.
동적으로 검색 바를 추가했습니다. 구현 방법에 대한 첨부 스크린 샷을 찾아보십시오.
코드를 살펴 보자
myseekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
final RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
p.addRule(RelativeLayout.ALIGN_RIGHT, seekBar.getId());
Rect thumbRect = myseekbar.getSeekBarThumb().getBounds();
Log.v("TAG", "ThumbRect Region : " + thumbRect.centerX());
p.setMargins(0, thumbRect.centerY() *12, 0, 0);
// tvProgress.setPadding(thumbRect.centerY() * 2, 0, 0, 0);
tvProgress.setVisibility(View.VISIBLE);
tvProgress.setLayoutParams(p);
//tvProgress.setY(progress * 10);
tvProgress.setText(String.valueOf(progress));
tvProgress.invalidate();
}
@Override
public void onStartTrackingTouch(SeekBar seekBar)
{
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
tvProgress.setVisibility(View.GONE);
}
});
문제 :
다음for (int i = 0; i <= undertimearray.length - 1; i++) {
LayoutInflater layoutInfralte = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View inflatedView = layoutInfralte.inflate(R.layout.element_sliderandtext, ll_rightside, false);
TextView submittedByTextView = (TextView) inflatedView.findViewById(R.id.txt_underseekbar);
submittedByTextView.setText(undertimearray[i]);
//rl_seekbarandtext=(RelativeLayout)inflatedView. findViewById(R.id.rl_seekbarandtext);
myseekbar = (TextThumbSeekBar) inflatedView.findViewById(R.id.myseekbar);
tvProgress = (TextView) inflatedView.findViewById(R.id.tv_progress);
myseekbar.setMax(50);
ll_tempvalues.post(new Runnable() {
@Override
public void run() {
height = ll_tempvalues.getHeight();
// Log.e("TAG", "TAG" + "=height=" + height);
}
});
ll_rightside.addView(inflatedView);
}
우리가 엄지 손가락 위에 떠있는 텍스트를 표시 달성하기 위해 노력했다 무엇 : 여러 검색 막대의
구현 우리가 직면하고있는 것은 onStopTrackingTouch가 호출되지 않고 있기 때문에 진행 텍스트가 숨어 있지 않기 때문입니다. 또한 onTouchEvent 리스너 내부의 ACTION_CANCEL에 상태가 표시되지 않습니다.
엄지 및 수직 검색 바에 대한 링크를 사용했습니다. [엄지 링크 및 추가 된 canvas.rotate (-90); canvas.translate (-getHeight(), 0); 당신은 당신이 공유 한 이미지를 바탕으로 SeekBar를 클래스를 확장하고 사용자 정의 검색 막대를 만든 것처럼] 수직 SeekBar를 1
엄지 위의 부동 텍스트를 추가하고 싶습니다. –