When editing XML files in the editor for Eclipse, line numbers are not displayed.
Use case:
I create a layout with many views, one of these lacks android:layout_
To make the line numbers always show for Android Studio:
File > Settings > Editor > Appearance then click the "Show line numbers" box.
The accepted answer works, but it will only make the line numbers visible on the active editor.
File > Settings > Editor > Appearance then click the "Show line numbers" box.
To make the line numbers show always in your android studio, follow this, go to: File > Settings > Editor > General > Appearance and then check the "Show line numbers" box especially if you are using AS 2.1.1. Picture here below...How to show line numbers in Android Studio 2.1.1
In eclipse: Windows > Preferences > General > Editors > Text Editors check: "show line numbers" It is not checked by default. It is for both source code and xml files (at least in helios)
try right clicking the grey bar and selecting show line numbers it works for me so hopefully it will for u too
or change it in the settings
File > Settings > Editor > Appearance then click the "Show line numbers" box.
On OS X: Android Studio (top left of the screen) > Preferences > Editor > Appearance.