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

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

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

TextView.setMaxHeight介绍

暂无

代码示例

代码示例来源:origin: Manabu-GT/ExpandableTextView

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
  final int newHeight = (int)((mEndHeight - mStartHeight) * interpolatedTime + mStartHeight);
  mTv.setMaxHeight(newHeight - mMarginBetweenTxtAndBottom);
  if (Float.compare(mAnimAlphaStart, 1.0f) != 0) {
    applyAlphaAnimation(mTv, mAnimAlphaStart + interpolatedTime * (1.0f - mAnimAlphaStart));
  }
  mTargetView.getLayoutParams().height = newHeight;
  mTargetView.requestLayout();
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

@Override
  public void onAnimationUpdate(ValueAnimator valueAnimator) {
    int animatedValue = (int) valueAnimator.getAnimatedValue();
    mTvContent.setMaxHeight(animatedValue - mMarginBetweenTxtAndBottom);
    getLayoutParams().height = animatedValue;
    requestLayout();
  }
});

代码示例来源:origin: czy1121/update

tv.setVerticalScrollBarEnabled(true);
tv.setTextSize(14);
tv.setMaxHeight((int) (250 * density));

代码示例来源:origin: rey5137/material

v.setMaxHeight(a.getDimensionPixelSize(attr, -1));

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

TextView tv1=(TextView)findViewById(R.id.textView1);
 tv1.setMaxHeight(maxHeight);

代码示例来源:origin: whyalwaysmea/BigBoom

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
  final int newHeight = (int)((mEndHeight - mStartHeight) * interpolatedTime + mStartHeight);
  mTv.setMaxHeight(newHeight - mMarginBetweenTxtAndBottom);
  if (Float.compare(mAnimAlphaStart, 1.0f) != 0) {
    applyAlphaAnimation(mTv, mAnimAlphaStart + interpolatedTime * (1.0f - mAnimAlphaStart));
  }
  mTargetView.getLayoutParams().height = newHeight;
  mTargetView.requestLayout();
}

代码示例来源:origin: lucid-lynxz/BlogSamples

private void doResize() {
    TextView container = (TextView) this.mContainerRef.get();
    if (container != null) {
      if (Build.VERSION.SDK_INT >= 14) {
        container.setMaxHeight(99999);
      } else {
        container.setEllipsize((TextUtils.TruncateAt) null);
      }

      container.setText(container.getText());
    }
  }
}

代码示例来源:origin: Tencent/RapidView

public void run(RapidParserObject object, Object view, Var value) {
    int height = 0;
    String str = value.getString();
    if( str.length() >= 1 && str.substring(str.length() - 1).compareToIgnoreCase("%") == 0 ){
      float percent = Float.parseFloat(str.substring(0, str.length() - 1)) / 100;
      height = (int)(percent * object.mScreenHeight);
    }
    else if( str.length() >= 2 && str.substring(str.length() - 2).compareToIgnoreCase("%x") == 0 ){
      float percent = Float.parseFloat(str.substring(0, str.length() - 2)) / 100;
      height = (int)(percent * object.mScreenWidth);
    }
    else if( str.length() >= 2 && str.substring(str.length() - 2).compareToIgnoreCase("%y") == 0 ){
      float percent = Float.parseFloat(str.substring(0, str.length() - 2)) / 100;
      height = (int)(percent * object.mScreenHeight);
    }
    else{
      height = ViewUtils.dip2px(object.mContext, value.getFloat());
    }
    ((TextView)view).setMaxHeight(height);
  }
}

代码示例来源:origin: calvinaquino/LNReader-Android

@Override
  public void run() {
    TextView txtDebug = (TextView) findViewById(R.id.txtDebug);
    try {
      PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
      if (!pInfo.versionName.contains("beta"))
        txtDebug.setMaxHeight(0);
      txtDebug.setText(message);
    } catch (Exception ex) {
      txtDebug.setVisibility(View.GONE);
    }
  }
});

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

case Sensor.TYPE_ACCELEROMETER:
  mTextAccTitle.setVisibility(0);
  mTextAccTitle.setMaxHeight(30);
  mTextAcc.setVisibility(0);
  mTextAcc.setMaxHeight(100);
  mTextGyrTitle.setMaxHeight(30);
  mTextGyr.setVisibility(0);
  mTextGyr.setMaxHeight(100);
  mTextLigTitle.setMaxHeight(30);
  mTextLig.setVisibility(0);
  mTextLig.setMaxHeight(100);
  mTextMagTitle.setMaxHeight(30);
  mTextMag.setVisibility(0);
  mTextMag.setMaxHeight(100);
  mTextOriTitle.setMaxHeight(30);
  mTextOri.setVisibility(0);
  mTextOri.setMaxHeight(100);
  mTextPreTitle.setMaxHeight(30);
  mTextPre.setVisibility(0);
  mTextPre.setMaxHeight(100);
  mTextProTitle.setMaxHeight(30);
  mTextPro.setVisibility(0);
  mTextPro.setMaxHeight(100);

代码示例来源:origin: cattaka/LearnAnimation

@Override
  public void onClick(View view) {
    if (view.getId() == R.id.button_hide) {
      int from = mLabelText.getWidth();
      int to = 0;
      ObjectAnimator.ofInt(mLabelText, "width", from, to).start();
    } else if (view.getId() == R.id.button_show) {
      int from = mLabelText.getWidth();
      mLabelText.setMaxWidth(Integer.MAX_VALUE);
      mLabelText.setMaxHeight(Integer.MAX_VALUE);
      mLabelText.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
      int to = mLabelText.getMeasuredWidth();
      ObjectAnimator.ofInt(mLabelText, "width", from, to).start();
    }
  }
}

代码示例来源:origin: MoMoWait/LeanbackLauncher

if (action.hasMultilineDescription()) {
  title.setMaxLines(res.getInteger(R.integer.lb_dialog_action_title_max_lines));
  description.setMaxHeight(getDescriptionMaxHeight(this.itemView.getContext(), title));
} else {
  title.setMaxLines(res.getInteger(R.integer.lb_dialog_action_title_min_lines));

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

mIb.setBackgroundColor(Color.TRANSPARENT);
mTv.setMaxHeight(Utils.convertDp(80, this));
mTv.setMaxWidth(Utils.convertDp(80, this));

代码示例来源:origin: jelic98/dynamico

textView.setMaxHeight(Display.unitToPx(attributes.getString("maxHeight"), context));

相关文章

TextView类方法