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

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

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

TextView.setMinHeight介绍

暂无

代码示例

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

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

代码示例来源:origin: H07000223/FlycoDialog_Master

mTvTitle.setMinHeight(dp2px(48));
  mTvTitle.setGravity(Gravity.CENTER_VERTICAL);
  mTvTitle.setPadding(dp2px(15), dp2px(5), dp2px(0), dp2px(5));
  mTvContent.setMinHeight(dp2px(68));
  mTvContent.setGravity(mContentGravity);
} else if (mStyle == STYLE_TWO) {
  mTvContent.setPadding(dp2px(15), dp2px(7), dp2px(15), dp2px(20));
  mTvContent.setMinHeight(dp2px(56));
  mTvContent.setGravity(Gravity.CENTER);

代码示例来源:origin: rockerhieu/rv-adapter-endless

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
  if (holder instanceof ItemViewHolder) {
    ItemViewHolder itemViewHolder = (ItemViewHolder) holder;
    itemViewHolder.mBoundString = mValues.get(position);
    itemViewHolder.mTextView.setText(position + ":" + mValues.get(position));
    itemViewHolder.mTextView.setMinHeight((50 + mValues.get(position).length() * 10));
  }
}

代码示例来源:origin: JustinRoom/JSCKit

private View createDefaultHeader() {
    TextView textView = new TextView(getContext());
    textView.setPadding(0, 32, 0, 32);
    textView.setGravity(Gravity.CENTER);
    textView.setMinHeight(300);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
    textView.setBackgroundColor(0xfff2f2f2);
    textView.setText("Header");
    textView.setTextColor(0xff333333);
    return textView;
  }
}

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

TabHost.TabSpec spec;  // Reusable TabSpec for each tab
TextView txtTabInfo; // Reusable tab indicator

// Create our tab indicator
txtTabInfo = new TextView(this);
txtTabInfo.setText("videos");
txtTabInfo.setTextSize(16);
txtTabInfo.setTypeface(Typeface.DEFAULT_BOLD);
txtTabInfo.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
txtTabInfo.setBackgroundResource(R.drawable.minitab);
txtTabInfo.setMinHeight(55);

spec = tabHostMM.newTabSpec("video");
spec.setContent(R.id.mm_video);
spec.setIndicator(txtTabInfo);
tabHostMM.addTab(spec);

代码示例来源:origin: tikeyc/TAndroidEChart

@Override
  public View getView(int i, View view, ViewGroup viewGroup) {
    if (view == null) {
      TextView textView = new TextView(TEchartTypeListActivity.this);
      view = textView;
      textView.setMinWidth(DensityUtil.getScreenWidth());
      textView.setMinHeight(100);
      textView.setPadding(40,0,0,0);
      textView.setGravity(Gravity.CENTER_VERTICAL);
    }
    TextView textView = (TextView) view;
    textView.setText(chartTypes[i]);
    return view;
  }
}

代码示例来源: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).setMinHeight(height);
  }
}

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

params.height = LayoutParams.WRAP_CONTENT;                              
textView.setLayoutParams(params);
textView.setMinHeight(height);

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

ListView lvLogs = new ListView(this);
lvLogs.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, logs) {

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      View view = super.getView(position, convertView, parent);
      TextView textView = ((TextView) view.findViewById(android.R.id.text1));
      textView.setMinHeight(0); // Min Height
      textView.setMinimumHeight(0); // Min Height 
      textView.setHeight(44); // Height
      return view;
    }
  });

代码示例来源:origin: FangWW/ComparisonCar

tableCellView.img_del.setVisibility(View.GONE);
tableCellView.img_rank.setVisibility(View.GONE);
tableCellView.tvTitle.setMinHeight(cellHieght);
tableCellView.tvTitle.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
tableCellView.tvTitle.setGravity(Gravity.CENTER);

代码示例来源:origin: wintonBy/BottomNavigationView

/**
 * 初始化reminder view
 */
private void initRemindView() {
  LayoutParams layoutParams = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  layoutParams.addRule(RelativeLayout.ALIGN_LEFT,R.id.icon);
  layoutParams.topMargin = iconMarginTop - 5;
  layoutParams.leftMargin = iconSize - 10;
  reminderView.setTextColor(Color.WHITE);
  reminderView.setGravity(Gravity.CENTER);
  reminderView.setPadding(5,5,5,5);
  reminderView.setMinHeight(dp2px(getContext(),10));
  reminderView.setMinWidth(dp2px(getContext(),10));
  this.addView(reminderView,layoutParams);
  updateReminder(reminder,enableReminder);
}

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

applicationTextView.setMinHeight((int) FVRGeneralUtils.convertDpToPx(mContext, 25));
applicationTextView.setCompoundDrawablePadding((int) FVRGeneralUtils.convertDpToPx(mContext, 7));
convertView = applicationTextView;

代码示例来源:origin: wasdennnoch/AndroidN-ify

button.setPadding(dismissButtonPadding, dismissButtonPaddingTop, dismissButtonPadding, dismissButtonPadding);
button.setMinWidth(res.getDimensionPixelSize(R.dimen.notification_dismiss_button_min_width));
button.setMinHeight(res.getDimensionPixelSize(R.dimen.notification_dismiss_button_min_height));
button.setGravity(Gravity.CENTER);
layout.setPaddingRelative(0, 0, res.getDimensionPixelSize(R.dimen.notification_dismiss_view_padding_right), 0);

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

mTvTitle.setMinHeight(dp2px(48));
  mTvTitle.setGravity(Gravity.CENTER_VERTICAL);
  mTvTitle.setPadding(dp2px(15), dp2px(5), dp2px(0), dp2px(5));
  mTvContent.setMinHeight(dp2px(68));
  mTvContent.setGravity(mContentGravity);
} else if (mStyle == STYLE_TWO) {
  mTvContent.setPadding(dp2px(15), dp2px(7), dp2px(15), dp2px(20));
  mTvContent.setMinHeight(dp2px(56));
  mTvContent.setGravity(Gravity.CENTER);

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

textView.setMinHeight(Display.unitToPx(attributes.getString("minHeight"), context));

代码示例来源:origin: wutq/AndroidModuleDemo

@Override
  public void onBindData(SuperViewHolder holder, int viewType, int layoutPosition, final Article data) {
    ImageView imageView = holder.findViewById(R.id.iv_img);
    TextView tvDes = holder.findViewById(R.id.tv_des);
    if (!TextUtils.isEmpty(data.getEnvelopePic())) {
      ImageUtils.loadImage(imageView, data.getEnvelopePic());
      imageView.setVisibility(View.VISIBLE);
    } else {
      imageView.setVisibility(View.GONE);
      tvDes.setMinHeight(PxUtils.dp2px(getContext(), 25));
      tvDes.setMinimumHeight(PxUtils.dp2px(getContext(), 25));

    }
    Logger.e("getMinHeight:" + tvDes.getMinHeight());
    holder.setText(R.id.tv_des, data.getDesc());
    holder.setText(R.id.tv_author, String.format("作者:%s", data.getAuthor()));
    holder.setText(R.id.tv_date, data.getNiceDate());
  }
}

代码示例来源:origin: Carbs0126/MDDialog

tv.setTextColor(wrapper.contentTextColor);
tv.setTag(i);
tv.setMinHeight(itemHeight);
if(wrapper.messages.length == 1){
  if(wrapper.showTitle && wrapper.showButtons){

相关文章

TextView类方法