У меня есть текстовый вид, как это,TextView Совместите центр - Android
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/textView"
android:layout_centerHorizontal="true"/>
Он выровнен в центре по горизонтали, но теперь я хочу, чтобы переместить его 20P влево от центра. Поэтому я пробовал android:layout_marginStart="30dp" android:layout_marginLeft="30dp"
Но он остался посередине, как я могу переместить его влево, но иметь ссылку на центр?
Здесь полно XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.spencer.one.SplashScreenActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginStart="30dp"
android:layout_marginLeft="30dp"/>
</RelativeLayout>
Благодаря
Пожалуйста, покажите свой полный код XML , –
@ShoebSiddique см. Выше –
Пожалуйста, посмотрите мой ответ. –