3.1.4 textAlignment is missing ( Android Studio)

我的未来我决定 提交于 2019-12-05 14:06:43

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.

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"

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!