问题
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!
回答1:
Here's how I resolved the problem (on Android Studio 3.3 - Build #AI-182.5107.16.33.5199772, built on December 25, 2018):
- In Android Studio, open build.gradle (Module: app).
- Look for minSdkVersion
- 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.
- 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.
回答2:
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"
回答3:
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
回答4:
Changing the minSdkVersion to 17 worked for me. (Android Studio version 3.3.1)
来源:https://stackoverflow.com/questions/51730812/3-1-4-textalignment-is-missing-android-studio