Today i've updated my android sdk to 19 api, and while testing my app I have encountered some bugs in 19 api: drop some fonts in text view, or have problems with it's size.
first screen, code of one view:
tvBalance = new TextView(getContext());
rlParams = new LayoutParams(frame.width, (int) (frame.heigth * zoneExtetn));
rlParams.setMargins(frame.left, (int) (frame.top - frame.heigth * (zoneUp-0.1f)), 0, 0);
tvBalance.setLayoutParams(rlParams);
tvBalance.setGravity(Gravity.CENTER);
tvBalance.setPadding(0, 0, 0, 0);
tvBalance.setTextColor(0xffffd008);
tvBalance.setTextSize(PokerTextSize.scaleFont(getContext(), 28));
tvBalance.setText("$ 0 000 000 000");
tvBalance.setTypeface(TypefaceBase.getCalibri((Activity) getContext()));
rlMoney.addView(tvBalance);
and second screen code:
TextView tvText = new TextView(llContent.getContext());
llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
llParams.setMargins(0, 0, 0, marg*2);
tvText.setLayoutParams(llParams);
tvText.setTextSize(fonts[0]);
tvText.setTextColor(articleColor);
tvText.setText(Html.fromHtml(articleItem.getString()));
tvText.setTypeface(TypefaceBase.getCalibri((Activity) this.getContext()));
llContent.addView(tvText);
Anybody have these problems in android 4.4 kit-kat?
I'm having a similar issue, and found this thread. See if that helps.
Custom ttf fonts are not showing properly in TextView on Android 4.4 KitKat
Edit:
I was having the same issue while using calibri.ttf. I switched over to lato.ttf (available on google.com/fonts), and they work fine/look extremely similar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With