6

I have the new Version of Android Studio (3.1.4), but I can't find textAlignment. I've already searched in "View all Attributes". Do somebody now where I can find it.

Thanks for answering!

Community
  • 1
  • 1
Prorie
  • 61
  • 1
  • 3

6 Answers6

20

Here's how I resolved the problem (on Android Studio 3.3 - Build #AI-182.5107.16.33.5199772, built on December 25, 2018):

  1. In Android Studio, open build.gradle (Module: app).
  2. Look for minSdkVersion
  3. Changing this to 17 (from 15) did the trick for me. I suggest you try the same, unless you really need it to be earlier.
  4. Android Studio will rebuild your project and you should now see the textAlignment attribute right below textStyle.

Note: I had the same problem and I noticed that the TEXT_ALIGNMENT constants were only introduced in API level 17 (see https://developer.android.com/reference/android/view/View).

Let me know if this helps.

Paps Dali
  • 201
  • 2
  • 3
1

I currently use Android Studio 3.2.1 (Build #AI-181.5540.7.32.5056338, built on October 9, 2018) and it is still there for me. At the exact same place, where it has been in previous versions.

If you can't find it for some reason, there is still the possibility to write it manually within the properties of your TextView in the XML file with the following (changing "textStart" to the value you want):

android:textAlignment="textStart"
Geshode
  • 3,600
  • 6
  • 18
  • 32
0

Maybe rebuilding the project or cleaning it will help you , it's available to me and i am using the below mentioned version of studio

Android Studio 3.2.1 Build #AI-181.5540.7.32.5056338, built on October 9, 2018 JRE: 1.8.0_152-release-1136-b06 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

Mavee Shah
  • 32
  • 7
0

Changing the minSdkVersion to 17 worked for me. (Android Studio version 3.3.1)

0

you need to use gravity-->center in all attribute pane for text alignment in newer version of android studio

SAGAR
  • 1
0

I am using android studio 4.2.2 and changing the sdk to 17 did bring the setting back as suggested above but changing the gravity to right and left also works similar to the text allignment.