List of usage examples for android.widget TextView setMaxHeight
@android.view.RemotableViewMethod public void setMaxHeight(int maxPixels)
From source file:cc.metapro.openct.myclass.TableFragment.java
private void addSeqViews() { final int DailyClasses = Integer .parseInt(PrefHelper.getString(getContext(), R.string.pref_daily_class_count, "12")); for (int i = 1; i <= DailyClasses; i++) { TextView textView = new TextView(getContext()); textView.setText(i + ""); textView.setGravity(Gravity.CENTER); textView.setMinHeight(Constants.CLASS_BASE_HEIGHT * Constants.CLASS_LENGTH); textView.setMaxHeight(Constants.CLASS_BASE_HEIGHT * Constants.CLASS_LENGTH); textView.setTextSize(10);/*from www.j a va 2 s .c om*/ mSeq.addView(textView); } }
From source file:com.example.SmartBoard.DrawingView.java
public Bitmap textToBitmap(String text, int color, float posX, float posY, int size) { TextView textView = new TextView(getContext()); textView.setVisibility(View.VISIBLE); textView.setTextColor(color);/*from ww w .j a va2s.c o m*/ textView.setMaxWidth(500); textView.setMaxHeight(500); textView.setMaxLines(4); textView.setX(posX); textView.setY(posY); textView.setText(text); textView.setTextSize(size); LinearLayout layout = new LinearLayout(getContext()); layout.addView(textView); layout.measure(500, 500); layout.layout(0, 0, 500, 500); textView.setDrawingCacheEnabled(true); textView.buildDrawingCache(); Bitmap bm = textView.getDrawingCache(); return bm; }