Open yeahia2508 opened 7 years ago
I'm trying to add autotextview from java code but not working .
AutofitTextView ivBowl = new AutofitTextView(this); ivBowl.setText(text); ivBowl.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30); ivBowl.setTextColor(Color.parseColor("#00463E")); ivBowl.setMinTextSize(TypedValue.COMPLEX_UNIT_SP,18); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); layoutParams.setMargins(5, 10, 0, 0); // left, top, right, bottom ivBowl.setLayoutParams(layoutParams); row2.addView(ivBowl);
I'm trying to add autotextview from java code but not working .
AutofitTextView ivBowl = new AutofitTextView(this); ivBowl.setText(text); ivBowl.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30); ivBowl.setTextColor(Color.parseColor("#00463E")); ivBowl.setMinTextSize(TypedValue.COMPLEX_UNIT_SP,18); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); layoutParams.setMargins(5, 10, 0, 0); // left, top, right, bottom ivBowl.setLayoutParams(layoutParams); row2.addView(ivBowl);