Help me figure out how to display a textview on a tablet. Code:

<TextView android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/confirmCode" android:id="@+id/textView5" android:gravity="center" android:layout_centerInParent="true" android:layout_below="@+id/editText" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" /> 

I'm testing on Lenovo A6010 and Samsung Tab2. On the tablet, the text view is on the left, and on the phone in the center. I'm missing something. Tell me

    1 answer 1

    Apparently he is with you and on the phone not in the center, but also on the left (but the screen is small and it seems in the center), because you put him down:

     android:layout_alignParentLeft="true" android:layout_alignParentStart="true" 

    So most likely removing the above attributes will solve your problem.

    • one
      You're right! Thanks - Ivan Vovk