You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio白线遮挡代码问题求助:新手重建项目无效

Fixing the Persistent White Line Blocking Code in Android Studio

Hey there! I totally get how annoying it is when a random white line blocks your code—especially when you’re still getting comfortable with Android Studio. Re-building the project didn’t work, so let’s walk through the most likely causes and fixes for this issue:

1. Misconfigured Indent Guides

This is the most common culprit. Sometimes the indent reference lines (which are usually thin, gray) get accidentally adjusted to thick white lines that overlap with your code.

  • Open File > Settings > Editor > General > Appearance (on Mac, it’s Android Studio > Settings > ...)
  • Find the Show indent guides option: uncheck it, click Apply, then re-check it. If that doesn’t fix it, click Configure Indent Guides next to it, set the line width back to the default 1px, and pick a light gray color (like #cccccc) instead of white.

2. Third-Party Plugin Conflict

Some third-party plugins (especially code highlighting, formatting, or UI customization ones) can glitch out and render unexpected lines.

  • Disable all non-official plugins first: Go to File > Settings > Plugins, use the Disabled filter to see active plugins, then disable any that aren’t made by Google/JetBrains. Restart Android Studio and check if the line is gone.
  • If it disappears, re-enable plugins one by one until you find the problematic one. You can either update that plugin to the latest version or uninstall it entirely.

3. Corrupted IDE Cache

Rebuilding your project only clears project-level cache—sometimes the IDE’s own cache gets corrupted and causes weird UI bugs like this.

  • The easiest way is to use the built-in cache reset: Go to File > Invalidate Caches..., check the Invalidate and Restart option, then confirm. Wait for Android Studio to restart and re-index your project.
  • If that doesn’t work, you can manually delete the cache folder:
    • Windows: C:\Users\<YourUsername>\.AndroidStudio<Version>\system\caches
    • Mac: ~/Library/Caches/Google/AndroidStudio<Version>
    • Linux: ~/.AndroidStudio<Version>/system/caches
      Delete the folder, then restart Android Studio.

4. Accidentally Enabled Column/Hard Wrap Guide

Sometimes a column boundary marker (set to wrap code at a specific line length) can look like a thick white line.

  • Check File > Settings > Editor > Code Style, select your language (Kotlin/Java), go to the Wrapping and Braces tab. Look for Hard wrap at—if it’s set to a low value (like 80), that might be the line you’re seeing. Either increase the value or uncheck the option if you don’t need it.
  • Also, check Editor > General > Appearance for the Show hard wrap guide option—uncheck it if it’s enabled and you don’t want that line.

内容的提问来源于stack exchange,提问作者Shubham Prince

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:25:43