Skip to content Skip to sidebar Skip to footer

Center Textview On RelativeLayout, When Other Textview It's Null (or Dont Have Text)

I followed this tutorial, for now it's working nice, but i only have a problem, i need to center vertically the 'Title' textview, when 'Detail' textview text it's null or empty, so

Solution 1:

Remember to setVisible(View.VISIBLE) when you are recycling a view.

String detail = "some detail....";
detailTextView.setVisible(detail == null ? View.GONE : View.VISIBLE);

Hope this helps


Post a Comment for "Center Textview On RelativeLayout, When Other Textview It's Null (or Dont Have Text)"