android.widget.TextView.setY()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中android.widget.TextView.setY()方法的一些代码示例,展示了TextView.setY()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setY()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setY

TextView.setY介绍

暂无

代码示例

代码示例来源:origin: baoyachi/StepView

mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTextSize);
mTextView.setText(mTexts.get(i));
mTextView.setY(complectedXPosition.get(i) - mStepsViewIndicator.getCircleRadius() / 2);
mTextView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));

代码示例来源:origin: naman14/Timber

private void setBubbleAndHandlePosition(float y) {
  int bubbleHeight = bubble.getHeight();
  int handleHeight = handle.getHeight();
  handle.setY(getValueInRange(0, height - handleHeight, (int) (y - handleHeight / 2)));
  bubble.setY(getValueInRange(0, height - bubbleHeight - handleHeight / 2, (int) (y - bubbleHeight)));
}

代码示例来源:origin: stackoverflow.com

int handleHeight=handle.getHeight();
handle.setY(getValueInRange(0,height-handleHeight,(int)(y-handleHeight/2)));
bubble.setY(getValueInRange(0,height-bubbleHeight-handleHeight/2,(int)(y-bubbleHeight)));

代码示例来源:origin: google/santa-tracker-android

@Override
  public void onAnimationUpdate(ValueAnimator valueAnimator) {
    currentScore.setX((float) valueAnimator.getAnimatedValue("x"));
    currentScore.setY((float) valueAnimator.getAnimatedValue("y"));
    currentScore.setTextSize(
        TypedValue.COMPLEX_UNIT_PX,
        (float) valueAnimator.getAnimatedValue("textSize"));
  }
},

代码示例来源:origin: google/santa-tracker-android

@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
  currentScore.setX((float) valueAnimator.getAnimatedValue("x"));
  currentScore.setY((float) valueAnimator.getAnimatedValue("y"));
  currentScore.setTextSize(
      TypedValue.COMPLEX_UNIT_PX,

代码示例来源:origin: google/santa-tracker-android

currentScore.setY(currentScoreY);

代码示例来源:origin: YoKeyword/IndexableRecyclerView

y = mIndexBar.getHeight();
mMDOverlay.setY(mIndexBar.getTop() + y - PADDING_RIGHT_OVERLAY);

代码示例来源:origin: smuyyh/SprintNBA

private void processRightOverlayView(float y) {
  if (mRightOverlayView != null) {
    if (y - dp80 > 0) {
      mRightOverlayView.setY(y - dp80);
    } else {
      mRightOverlayView.setY(0);
    }
  }
}

代码示例来源:origin: AmazMod/AmazMod

@Override
public void onAbsoluteScrollChange(int i) {
  // Only scroll the title up from its original base position
  // and not down.
  if (i > 0) {
    mHeader.setY(-i);
  }
}

代码示例来源:origin: AmazMod/AmazMod

@Override
public void onAbsoluteScrollChange(int i) {
  // Only scroll the title up from its original base position
  // and not down.
  if (i > 0) {
    mHeader.setY(-i);
  }
}

代码示例来源:origin: AmazMod/AmazMod

@Override
public void onAbsoluteScrollChange(int i) {
  // Only scroll the title up from its original base position
  // and not down.
  if (i > 0) {
    mHeader.setY(-i);
  }
}

代码示例来源:origin: stackoverflow.com

for(int i = 20; i < 550; i+=20){
  TextView myText = new TextView(getContext());
  myText.setY(i*3);
  myText.setText("HELLLLLOOOO");
  lr.addView(myText);
  lr1.addView(myText);
  lr2.addView(myText);
}

代码示例来源:origin: smuyyh/SprintNBA

@Override
  public void onSelection(int position, String indexTitle) {
    if (mStickView != null) {
      if (!mStickView.getText().toString().equals(indexTitle)) {
        mStickView.setText(indexTitle);
      }
      if (mStickView.getY() != 0) {
        mStickView.setY(0);
      }
    }
  }
});

代码示例来源:origin: nanchen2251/CoordinatorAppBarDemo

@Override
  public boolean onDependentViewChanged(CoordinatorLayout parent, TextView child, View dependency) {
    child.setX(dependency.getX());
    child.setY(dependency.getY() + 100);
    return true;
  }
}

代码示例来源:origin: akshay2211/PixImagePicker

private void setViewPositions(float y) {
  int handleY = Utility.getValueInRange(0, (int) (mViewHeight - mHandleView.getHeight()), (int) (y - mHandleView.getHeight() / 2));
  mBubbleView.setY(handleY + Utility.convertDpToPixel((56), Pix.this));
  mHandleView.setY(handleY);
}

代码示例来源:origin: githubwing/WingUE

@Override public void onAnimationUpdate(ValueAnimator valueAnimator) {
  mSearchBGTxt.setY((Float) valueAnimator.getAnimatedValue());
  mArrowImg.setY(
    mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mArrowImg.getHeight()) / 2);
  mHintTxt.setY(mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mHintTxt.getHeight()) / 2);
  mSearchTxt.setY(
    mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mSearchTxt.getHeight()) / 2);
 }
});

代码示例来源:origin: githubwing/WingUE

private void initLocation() {
 final float translateY = getTranslateY();
 //放到前一个页面的位置
 mSearchBGTxt.setY(mSearchBGTxt.getY() + translateY);
 mHintTxt.setY(mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mHintTxt.getHeight()) / 2);
 mSearchTxt.setY(mSearchBGTxt.getY() + (mSearchBGTxt.getHeight() - mSearchTxt.getHeight()) / 2);
}

代码示例来源:origin: brainysoon/cyberCar

private void setBubbleAndHandlePosition(float y) {
  int bubbleHeight = bubble.getHeight();
  int handleHeight = handle.getHeight();
  handle.setY(getValueInRange(0, height - handleHeight, (int) (y - handleHeight / 2)));
  bubble.setY(getValueInRange(0, height - bubbleHeight - handleHeight / 2, (int) (y - bubbleHeight)));
}

代码示例来源:origin: TobiasBielefeld/Simple-Solitaire

public void updateLimitedRecyclesCounter(){
  if (currentGame.hasLimitedRecycles() && !currentGame.hidesRecycleCounter()) {
    mainTextViewRecycles.setVisibility(VISIBLE);
    mainTextViewRecycles.setX(currentGame.getMainStack().getX());
    mainTextViewRecycles.setY(currentGame.getMainStack().getY());
  } else {
    mainTextViewRecycles.setVisibility(GONE);
  }
}

代码示例来源:origin: L4Digital/FastScroll

private void setViewPositions(float y) {
  bubbleHeight = bubbleView.getMeasuredHeight();
  handleHeight = handleView.getMeasuredHeight();
  int bubbleY = getValueInRange(0, viewHeight - bubbleHeight - handleHeight / 2, (int) (y - bubbleHeight));
  int handleY = getValueInRange(0, viewHeight - handleHeight, (int) (y - handleHeight / 2));
  if (showBubble) {
    bubbleView.setY(bubbleY);
  }
  handleView.setY(handleY);
}

相关文章

TextView类方法