mobile-design

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mobile Design

移动设计

Overview

概述

Design and build mobile applications that feel native on each platform. This skill covers React Native, Flutter, and SwiftUI with deep knowledge of platform-specific Human Interface Guidelines (Apple HIG) and Material Design, gesture handling, responsive layouts, offline-first patterns, and app store submission requirements.
设计并构建在各平台上都具备原生体验的移动应用。本技能涵盖React Native、Flutter和SwiftUI相关内容,深度掌握平台专属的人机界面指南(Apple HIG)和Material Design、手势处理、响应式布局、离线优先模式,以及应用商店提交要求。

Phase 1: Platform Analysis

阶段1:平台分析

  1. Identify target platforms (iOS, Android, both)
  2. Choose framework (React Native, Flutter, SwiftUI, or cross-platform)
  3. Review platform-specific design guidelines
  4. Define navigation architecture
  5. Map offline requirements
STOP — Present platform and framework recommendation with rationale before design.
  1. 确定目标平台(iOS、Android、双平台)
  2. 选择开发框架(React Native、Flutter、SwiftUI或跨平台方案)
  3. 查阅平台专属设计规范
  4. 定义导航架构
  5. 梳理离线功能需求
停止操作——在开展设计前,先给出平台和框架选择建议及理由。

Framework Selection Decision Table

框架选择决策表

RequirementReact NativeFlutterSwiftUIKotlin/Compose
iOS onlyPossiblePossibleBestNo
Android onlyPossiblePossibleNoBest
Cross-platformGoodBestNoNo
Native performance criticalOKGoodBestBest
Existing React web teamBestLearning curveLearning curveLearning curve
Complex animationsGoodBestGoodGood
Rapid prototypingGoodGoodBest (iOS)OK
Large existing codebase (JS)BestRewriteRewriteRewrite
需求React NativeFlutterSwiftUIKotlin/Compose
仅iOS可选可选最优不适用
仅Android可选可选不适用最优
跨平台良好最优不适用不适用
原生性能要求极高尚可良好最优最优
现有团队为React Web开发团队最优存在学习成本存在学习成本存在学习成本
复杂动画需求良好最优良好良好
快速原型开发良好良好最优(iOS端)尚可
现有大量JS代码库最优需要重写需要重写需要重写

Phase 2: Design Implementation

阶段2:设计实现

  1. Build component library with platform variants
  2. Implement navigation (tab bar, stack, drawer)
  3. Handle safe areas and notches
  4. Add gesture recognizers
  5. Implement responsive layouts for phone/tablet
STOP — Present navigation architecture and component inventory for review.
  1. 构建包含平台变体的组件库
  2. 实现导航功能(标签栏、堆栈、侧边抽屉)
  3. 适配安全区域和刘海屏
  4. 添加手势识别器
  5. 实现适配手机/平板的响应式布局
停止操作——提交导航架构和组件清单供审核。

Platform-Specific HIG Compliance

平台专属HIG合规

Apple Human Interface Guidelines

Apple人机界面指南

AreaGuideline
NavigationUINavigationController (push/pop), tab bars at bottom (max 5)
TypographySF Pro / SF Pro Rounded, support Dynamic Type (all 11 sizes)
Safe AreasRespect
safeAreaInsets
— never under notch/home indicator
GesturesSwipe-back for navigation, long press for context menus
HapticsUIFeedbackGenerator (impact, selection, notification)
ColorsSemantic system colors (
label
,
secondaryLabel
,
systemBackground
)
ModalsSheets (
.sheet
,
.fullScreenCover
) with drag-to-dismiss
ListsGrouped inset for settings, plain for content feeds
IconsSF Symbols library (5000+ icons, variable weight/size)
领域规范
导航UINavigationController(push/pop),底部标签栏最多5个
排版SF Pro / SF Pro Rounded,支持动态字体(全11种尺寸)
安全区域遵循
safeAreaInsets
规则,内容不可延伸至刘海/底部Home指示器下方
手势侧滑返回导航,长按唤出上下文菜单
触觉反馈UIFeedbackGenerator(震动、选择、通知三类反馈)
颜色语义化系统颜色(
label
secondaryLabel
systemBackground
模态框底部弹窗(
.sheet
.fullScreenCover
)支持拖拽关闭
列表设置页使用分组内嵌样式,内容流使用普通样式
图标SF Symbols图标库(5000+图标,支持可变字重/尺寸)

Material Design (Android)

Material Design(Android)

AreaGuideline
NavigationBottom navigation bar, navigation drawer, top app bar
TypographyRoboto / product font, Material type scale
Edge-to-edgeDraw behind system bars, handle window insets
GesturesPredictive back gesture (Android 14+), swipe-to-dismiss
HapticsHapticFeedbackConstants (click, long press, keyboard)
ColorsMaterial You dynamic color from wallpaper, tonal palettes
ComponentsFAB, snackbar, bottom sheet, chips
MotionShared element transitions, container transform
领域规范
导航底部导航栏、侧边导航抽屉、顶部应用栏
排版Roboto/产品定制字体,Material字体层级体系
边到边设计内容可延伸至系统栏下方,处理窗口 insets
手势预测性返回手势(Android 14+),滑动关闭
触觉反馈HapticFeedbackConstants(点击、长按、键盘输入反馈)
颜色基于壁纸的Material You动态颜色、色调调色板
组件悬浮操作按钮(FAB)、snackbar提示、底部弹窗、标签(chips)
动效共享元素转场、容器形变动效

Cross-Platform Pattern Decision Table

跨平台模式决策表

FeatureiOS PatternAndroid Pattern
Back navigationSwipe from left edgeSystem back button
Primary actionRight nav bar buttonFAB
AlertsUIAlertControllerMaterialAlertDialog
LoadingUIActivityIndicatorCircularProgressIndicator
SegmentedUISegmentedControlTabs / Chips
Date pickerWheel pickerCalendar picker
Pull to refreshNative supportSwipeRefreshLayout
Context menuLong press + hapticLong press + popup
功能iOS模式Android模式
返回导航左边缘侧滑系统返回键
主要操作导航栏右侧按钮悬浮操作按钮(FAB)
警告弹窗UIAlertControllerMaterialAlertDialog
加载状态UIActivityIndicatorCircularProgressIndicator
分段选择UISegmentedControl标签页/标签(Chips)
日期选择器滚轮选择器日历选择器
下拉刷新原生支持SwipeRefreshLayout
上下文菜单长按+触觉反馈长按+弹出菜单

Safe Area Handling

安全区域适配

React Native

React Native

jsx
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';

function Screen() {
  const insets = useSafeAreaInsets();
  return (
    <View style={{ flex: 1, paddingTop: insets.top, paddingBottom: insets.bottom }}>
      {/* Content */}
    </View>
  );
}
jsx
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';

function Screen() {
  const insets = useSafeAreaInsets();
  return (
    <View style={{ flex: 1, paddingTop: insets.top, paddingBottom: insets.bottom }}>
      {/* Content */}
    </View>
  );
}

Flutter

Flutter

dart
Widget build(BuildContext context) {
  return Scaffold(
    body: SafeArea(
      child: // Content
    ),
  );
}
dart
Widget build(BuildContext context) {
  return Scaffold(
    body: SafeArea(
      child: // Content
    ),
  );
}

SwiftUI

SwiftUI

swift
var body: some View {
  VStack {
    // Content automatically respects safe areas
  }
  .ignoresSafeArea(.keyboard) // Only ignore keyboard if needed
}
swift
var body: some View {
  VStack {
    // Content automatically respects safe areas
  }
  .ignoresSafeArea(.keyboard) // Only ignore keyboard if needed
}

Gesture Navigation Patterns

手势导航模式

GestureUsageMin Target
TapPrimary action44x44pt
Long pressContext menu / secondary action44x44pt
Swipe horizontalNavigation, dismiss, reveal actionsFull row
Swipe verticalScroll, pull-to-refresh, dismiss sheetFull area
PinchZoom images/mapsContent area
Pan/DragReorder, move elementsDrag handle
手势用途最小目标区域
点击主要操作44x44pt
长按上下文菜单/次要操作44x44pt
横向滑动导航、关闭、显示操作选项整行区域
纵向滑动滚动、下拉刷新、关闭弹窗全屏区域
捏合图片/地图缩放内容区域
平移/拖拽重排序、移动元素拖拽把手区域

Touch Target Rules

触控目标规则

RuleValue
Minimum size (iOS)44x44pt
Minimum size (Android)48x48dp
Minimum spacing8pt between targets
Visual vs touchVisual can be smaller; use padding for touch area
Primary actionsBottom 1/3 of screen (thumb zone)
规则数值
最小尺寸(iOS)44x44pt
最小尺寸(Android)48x48dp
最小间距触控目标之间间隔8pt
视觉尺寸与触控尺寸视觉元素可以更小,通过padding拓展触控区域
主要操作位置屏幕下方1/3区域(拇指易操作区)

Phase 3: Platform Polish

阶段3:平台体验优化

  1. Platform-specific animations and transitions
  2. Haptic feedback integration
  3. App icon and launch screen
  4. Dark mode and Dynamic Type support
  5. App store metadata and screenshots
STOP — Test on physical devices before declaring complete.
  1. 平台专属动画与转场效果
  2. 触觉反馈集成
  3. 应用图标和启动页设计
  4. 深色模式和动态字体支持
  5. 应用商店元数据和截图准备
停止操作——在宣布完成前,在物理设备上进行测试。

Responsive Layout Decision Table

响应式布局决策表

Form FactorLayoutNavigation
Phone PortraitSingle columnBottom tabs
Phone LandscapeSingle column or splitSide tabs
Tablet PortraitTwo columnsSidebar
Tablet LandscapeThree columnsPersistent sidebar
设备形态布局导航
手机竖屏单列底部标签栏
手机横屏单列或双列侧边标签栏
平板竖屏双列侧边栏
平板横屏三列常驻侧边栏

React Native Responsive

React Native 响应式实现

javascript
import { useWindowDimensions } from 'react-native';

function useResponsive() {
  const { width } = useWindowDimensions();
  return {
    isPhone: width < 768,
    isTablet: width >= 768 && width < 1024,
    isDesktop: width >= 1024,
    columns: width < 768 ? 1 : width < 1024 ? 2 : 3,
  };
}
javascript
import { useWindowDimensions } from 'react-native';

function useResponsive() {
  const { width } = useWindowDimensions();
  return {
    isPhone: width < 768,
    isTablet: width >= 768 && width < 1024,
    isDesktop: width >= 1024,
    columns: width < 768 ? 1 : width < 1024 ? 2 : 3,
  };
}

Flutter Responsive

Flutter 响应式实现

dart
class ResponsiveLayout extends StatelessWidget {
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (context, constraints) {
        if (constraints.maxWidth < 600) return MobileLayout();
        if (constraints.maxWidth < 1200) return TabletLayout();
        return DesktopLayout();
      },
    );
  }
}
dart
class ResponsiveLayout extends StatelessWidget {
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (context, constraints) {
        if (constraints.maxWidth < 600) return MobileLayout();
        if (constraints.maxWidth < 1200) return TabletLayout();
        return DesktopLayout();
      },
    );
  }
}

Offline-First Architecture

离线优先架构

LayerPatternImplementation
DataLocal-firstSQLite/Realm as primary store, server as sync target
UpdatesOptimisticApply locally, sync in background
ConflictsResolution strategyLast-write-wins or field-level merge
QueuePersistent opsStore pending operations, retry on connectivity
CacheStale-while-revalidateServe cached, refresh in background
层级模式实现方案
数据层本地优先SQLite/Realm作为主存储,服务端作为同步目标
更新层乐观更新本地先生效,后台异步同步
冲突处理解决策略最后写入优先或字段级合并
队列层持久化操作存储待执行操作,网络恢复后重试
缓存层缓存优先同时后台刷新优先返回缓存内容,后台异步刷新数据

Implementation Checklist

实现检查清单

  • Network status detection and UI indicator
  • Local database for all critical data
  • Operation queue for pending writes
  • Retry logic with exponential backoff
  • Conflict detection and resolution strategy
  • Cache invalidation policy
  • Sync status indicator in UI
  • Graceful degradation for network-only features
  • 网络状态检测及UI提示
  • 所有关键数据存储在本地数据库
  • 待写入操作队列
  • 带指数退避的重试逻辑
  • 冲突检测与解决策略
  • 缓存失效策略
  • UI层同步状态提示
  • 仅网络可用功能的优雅降级

App Store Guidelines Summary

应用商店规范汇总

RequirementApple App StoreGoogle Play Store
Screenshots6.7" and 5.5" required, 12.9" iPadMin 2, max 8 per device
App icon1024x1024px, no alpha, no corners512x512px, adaptive recommended
PrivacyNutrition labels requiredData safety section required
Review time24-48 hours typicalHours to days
Common rejectionsCrashes, placeholder contentPolicy violations, crashes
要求苹果应用商店谷歌应用商店
截图要求提供6.7英寸和5.5英寸机型截图,iPad需提供12.9英寸截图单设备最少2张,最多8张
应用图标1024x1024px,无alpha通道,无圆角512x512px,推荐使用自适应图标
隐私要求必须提供隐私营养标签必须填写数据安全板块
审核时长通常24-48小时数小时到数天不等
常见驳回原因崩溃、占位内容政策违规、崩溃

Performance Targets

性能指标目标

MetricTarget
Cold start< 2 seconds
Screen transition< 300ms
Touch response< 100ms
Scroll FPS60fps (no drops)
Memory usage< 200MB baseline
App size< 50MB download
指标目标值
冷启动小于2秒
页面转场小于300ms
触控响应小于100ms
滚动帧率60fps(无掉帧)
内存占用基线小于200MB
应用大小下载包小于50MB

Anti-Patterns / Common Mistakes

反模式/常见错误

Anti-PatternWhy It Is WrongWhat to Do Instead
Web patterns in mobile (hover states)No hover on touch devicesUse press/tap states
Tiny touch targets (< 44pt)Frustrating, accessibility failMinimum 44x44pt touch area
iOS-styled buttons on AndroidFeels foreign, confuses usersUse platform-native components
Fixed layouts for one screen sizeBreaks on tablets and foldablesResponsive layouts with breakpoints
Blocking main thread with I/OUI freezes, ANR dialogsAsync I/O, background threads
Not handling keyboard appearanceContent hidden behind keyboardAdjust layout on keyboard show
Assuming constant connectivityApp crashes or hangs offlineOffline-first architecture
Pixel values instead of dp/ptDifferent sizes on different screensUse density-independent units
Skipping haptic feedbackApp feels cheap and unresponsiveAdd haptics for key interactions
反模式错误原因优化方案
在移动端使用Web模式(比如hover状态)触控设备没有hover交互使用按压/点击状态
触控目标过小(小于44pt)操作体验差,不符合无障碍要求保证最小44x44pt的触控区域
在Android上使用iOS风格的按钮体验违和,容易误导用户使用平台原生组件
仅适配单一屏幕尺寸的固定布局在平板和折叠屏设备上布局错乱使用带断点的响应式布局
I/O操作阻塞主线程UI卡顿,出现应用无响应弹窗使用异步I/O、后台线程处理
未处理键盘弹出场景内容被键盘遮挡键盘弹出时调整布局
默认网络始终可用离线时应用崩溃或卡死采用离线优先架构
使用像素值而非dp/pt单位在不同屏幕上显示尺寸不一致使用密度无关单位
忽略触觉反馈应用体验廉价、响应感差在核心交互中添加触觉反馈

Documentation Lookup (Context7)

文档查询(Context7)

Use
mcp__context7__resolve-library-id
then
mcp__context7__query-docs
for up-to-date docs. Returned docs override memorized knowledge.
  • react-native
    — for component API, navigation, or platform-specific modules
  • flutter
    — for widget catalog, state management, or platform channels

先调用
mcp__context7__resolve-library-id
,再调用
mcp__context7__query-docs
获取最新文档,返回的文档优先级高于记忆中的知识。
  • react-native
    — 查询组件API、导航、平台专属模块相关内容
  • flutter
    — 查询组件目录、状态管理、平台通道相关内容

Integration Points

集成点

SkillIntegration
ui-ux-pro-max
Color palettes, typography, UX guidelines
ui-design-system
Design tokens adapted for mobile
canvas-design
Mobile data visualization and charts
ux-researcher-designer
Mobile usability testing
senior-frontend
React Native component implementation
deployment
App store submission pipeline
performance-optimization
Mobile performance profiling
技能集成场景
ui-ux-pro-max
色板、排版、UX规范
ui-design-system
适配移动端的设计令牌
canvas-design
移动端数据可视化和图表
ux-researcher-designer
移动可用性测试
senior-frontend
React Native组件实现
deployment
应用商店提交流水线
performance-optimization
移动性能分析

Skill Type

技能类型

FLEXIBLE — Adapt patterns to the chosen framework and target platforms. Platform-specific guidelines should be followed when targeting a single platform; cross-platform apps may blend conventions thoughtfully.
灵活适配——根据选择的框架和目标平台调整模式。针对单一平台开发时应当遵循平台专属规范;跨平台应用可合理融合不同平台的交互惯例。