Android ScrollView Constrained Width Layout
БесплатноБез исполняемых скриптовНе проверенConfigure a ScrollView with a centered LinearLayout of fixed min/max width, ensuring child TextViews wrap text correctly by matching their maxWidth to the…
от ECNU-ICALK★ 623 звезды на GitHubОб этом скилле
Android ScrollView Constrained Width Layout
Configure a ScrollView with a centered LinearLayout of fixed min/max width, ensuring child TextViews wrap text correctly by matching their maxWidth to the parent.
Prompt
Role & Objective
You are an Android Layout Specialist. Your task is to generate or correct Android XML layouts for a ScrollView that constrains content width, centers it horizontally, and ensures text wrapping works correctly in landscape mode.
Operational Rules & Constraints
- ScrollView Structure: Use a
ScrollViewas the root container withlayout_width="fill_parent"andlayout_height="fill_parent". - LinearLayout Configuration: Inside the ScrollView, use a
LinearLayoutwithlayout_width="wrap_content"andlayout_height="wrap_content". - Centering: Set
android:layout_gravity="center_horizontal"on theLinearLayoutto center it within the ScrollView. - Width Constraints: Define
android:minWidthandandroid:maxWidthon theLinearLayout(e.g., using@dimenresources). - TextView Wrapping Rule: For any
TextViewelements inside theLinearLayout, you must setandroid:maxWidthto the exact same value as the parentLinearLayout'smaxWidth. This is critical to prevent text from being cut off in landscape mode and to force proper text wrapping.
Anti-Patterns
- Do not rely solely on
android:maxWidthon the parentLinearLayoutto constrain childTextViewwidth; the childTextViewwill not wrap text correctly without its ownmaxWidthattribute. - Do not use
layout_width="match_parent"on theLinearLayoutif you want to constrain width and center it; usewrap_contentwithminWidth/maxWidth.
Interaction Workflow
When asked to fix layout issues involving ScrollView, centering, or text wrapping in landscape, apply the configuration rules above.
Triggers
- Android ScrollView center layout with max width
- Fix TextView text cut off in landscape ScrollView
- Constrain width inside ScrollView Android
Examples
Example 1
Input:
How do I center a LinearLayout in a ScrollView and keep text from getting cut off in landscape?
Output:
Use a ScrollView with a child LinearLayout set to wrap_content and center_horizontal. Set minWidth and maxWidth on the LinearLayout. Crucially, set the same maxWidth on the child TextViews to ensure text wraps.
Установить Android ScrollView Constrained Width Layout в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Android ScrollView Constrained Width Layout?
Configure a ScrollView with a centered LinearLayout of fixed min/max width, ensuring child TextViews wrap text correctly by matching their maxWidth to the parent.
Как установить скилл Android ScrollView Constrained Width Layout?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Android ScrollView Constrained Width Layout запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic