Eclipse 或 Android Studio XML 编辑器中没有行号

发布于 2024-11-03 06:14:06 字数 210 浏览 5 评论 0原文

在 Eclipse 编辑器中编辑 XML 文件时,不显示行号。

用例:

我创建一个包含许多视图的布局,其中一个缺少 android:layout_width 属性。当二进制 XML 布局资源膨胀时,这会导致运行时错误。错误日志告诉我检查 XML 文件中的 361 之类的内容。

由于显示了行号,我可以找到有问题的行并进行更改,而无需在另一个编辑器中打开文件。

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_width attribute. This causes a runtime error when the binary XML layout resource is inflated. The error log tells me to check like 361 in my XML file.

Thanks to the line number being displayed I can find the offending line and make the change without having to open the file in another editor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

如果没有你 2024-11-10 06:14:06

尝试右键单击灰色条并选择显示行号
它对我有用,希望对你也有用

在此处输入图像描述

在此处输入图像描述

或更改设置

文件>设置>编辑>然后单击出现的“显示行号”框。

try right clicking the grey bar and selecting show line numbers
it works for me so hopefully it will for u too

enter image description here

enter image description here

or change it in the settings

File > Settings > Editor > Appearance then click the "Show line numbers" box.

月依秋水 2024-11-10 06:14:06

如果您使用的是 Android Studio,您可以通过转到 File > > 显示行号。设置>编辑>一般>外观,然后选中“显示行号”框。

更新: Android Studio v1.5+
输入图像描述此处

1) 在编辑器内单击,Command + Shift + A,然后键入“显示行号”

2) 选择“首选项”中的第二个选项,它将带您进入屏幕过去普遍存在的>外观

3) 勾选“显示行号”框

If you're using Android Studio, you can show the line numbers by going to File > Settings > Editor > General > Appearance, then check the "Show line numbers" box.

UPDATE: Android Studio v1.5+
enter image description here

1) Click inside the editor, Command + Shift + A, and type "show line numbers"

2) Select the second option in Preferences and it will take you to the screen that used to exist in General > Appearance

3) Check the "Show Line Numbers" box

脸赞 2024-11-10 06:14:06

文件>设置>编辑>然后单击出现的“显示行号”框。

在此处输入图像描述

File > Settings > Editor > Appearance then click the "Show line numbers" box.

enter image description here

蓝梦月影 2024-11-10 06:14:06

在 Eclipse 中: Windows >首选项>一般>编辑>文本编辑器
检查:“显示行号”
默认情况下不选中它。它适用于源代码和 xml 文件(至少在 helios 中)

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)

别闹i 2024-11-10 06:14:06

要使 Android Studio 始终显示行号:

文件>设置>编辑>出现后单击“显示行号”框。

接受的答案有效,但它只会使行号在活动编辑器上可见。

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.

挖个坑埋了你 2024-11-10 06:14:06

在 OS X 上:Android Studio(屏幕左上方)>首选项>编辑>外貌。

On OS X: Android Studio (top left of the screen) > Preferences > Editor > Appearance.

迷鸟归林 2024-11-10 06:14:06

2013 年 12 月:从 Eclipse 4.4 开始,您无需寻找查看行号的选项,因为它们默认情况下可见

关于 Android Studio,这是另一个故事:自 2013 年 5 月起,Android Studio 0.3.x+ 是 基于 IntelliJ IDEA
请参阅“如何在 IntelliJ 中永久拥有行号?”。


拉尔斯·沃格尔只是发表在他的博客

开始,Eclipse SDK Luna (4.4) 中的行号是默认的

从今天(2013 年 12 月 10 日)

我们进行了一项用户调查,了解用户是否希望在 Eclipse IDE 的文本编辑器中默认激活行号。
回复非常明确:

YES : 80.07% (1852 responses)
NO  : 19.93% (461 responses)
Total  : 2313
Skipped:   15

对于 错误 421313回顾 - 默认情况下应激活行号,我们为Eclipse SDK 构建,我假设其他 Eclipse 包也会随之而来。

Dec 2013: Starting with Eclipse 4.4, you won't have to look for an option to see line numbers, because they will be visible by default.

Regarding Android Studio, this is another story: since May 2013, Android Studio 0.3.x+ is based on IntelliJ IDEA.
See "How can I permanently have line numbers in IntelliJ?".


Lars Vogel just published on his blog:

Line numbers are default in Eclipse SDK Luna (4.4) as of today

(December 10, 2013)

We conducted a user survey if users want to have line numbers activated in text editors in the Eclipse IDE by default.
The response was very clear:

YES : 80.07% (1852 responses)
NO  : 19.93% (461 responses)
Total  : 2313
Skipped:   15

With Bug 421313, Review - Line number should be activated by default, we enabled it for the Eclipse SDK build, I assume other Eclipse packages will follow.

情仇皆在手 2024-11-10 06:14:06

我知道这是一个老问题,但我刚刚遇到这个问题,所以我必须为自己找到解决方案。我认为根据我之前阅读的答案,菜单已经发生了一些变化。以下是如何在 MAC 上的 Android Studio 1.5 上执行此操作。

您首先单击要查看数字的窗口“编辑器”,然后只需选择下面两个建议的解决方案之一。

最简单的方法就是右键单击灰色栏,如 owen-gerig 显示,我认为这是最简单的,但如果你想通过菜单设置它,你可以通过 View ->;活动编辑器 ->显示行号。希望这有帮助。

行编号在适用于 MAC 的 Android Studio 1.5 上

I know this is an old question but I just came across the problem so I had to find a solution for my self. I assume the menu has changed a bit based on the previous answers that I am reading. So here is how to do it on Android Studio 1.5 on MAC.

You first click on the window "editor" that you want to see the numbers and then simply choose one of the two proposed solutions under.

The easiest way is simply right click on the grey bar as owen-gerig shows, which I think is the easiest, but if you want to set it through the menu you can via View -> Active Editor -> Show Line Numbers. Hope this helps.

Line Numbering on Android Studio 1.5 for MAC

小情绪 2024-11-10 06:14:06

要使行号始终显示在您的 Android Studio 中,请按照此操作,转到:
文件>设置>编辑>一般>外观,然后选中“显示行号”框,特别是如果您使用的是 AS 2.1.1。如下图...如何在 Android Studio 2.1.1 中显示行号

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文