Thuta Learning
React Native
IntermediateMobile Developmentအလယ်အလတ်

Responsive, Edge-to-Edge & Accessible UI

React Nativeသင်ခန်းစာ 1620 မိနစ်

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Responsive, Edge-to-Edge & Accessible UI ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
  • Accessibility, failure နဲ့ lifecycle cases စမ်းနိုင်ရန်
  • Maintainable, testable နဲ့ performant React Native code ရေးနိုင်ရန်

ရိုးရိုးလေး ရှင်းပြမယ်

Responsive, Edge-to-Edge & Accessible UI ကို ရိုးရိုးလေးနားလည်မယ်

Responsive, Edge-to-Edge & Accessible UI ကို screen တစ်ခုအတွက် style syntax အဖြစ်သာမမြင်ဘဲ Yoga constraints, pixel density, font scaling, safe areas, keyboard, touch target, accessibility tree နဲ့ iOS/Android behavior ကွာခြားမှုတို့ပါသော native UI contract အဖြစ်နားလည်ပါ။

Problem → Why → Solution

ပြဿနာ — ဘာကြောင့် ဒီ concept လိုတာလဲ

Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။

ဖြစ်လေ့ရှိတဲ့အမှား

Web CSS/DOM assumptions ကို React Native တွင်တိုက်ရိုက်သုံးခြင်း၊ subscription မပိတ်ခြင်း သို့ platform differences ကို condition အများကြီးဖြင့် component ထဲရောထည့်ခြင်း။

Core Concept — အလုပ်လုပ်ပုံကိုနားလည်မယ်

Responsive, Edge-to-Edge & Accessible UI ကို screen တစ်ခုအတွက် style syntax အဖြစ်သာမမြင်ဘဲ Yoga constraints, pixel density, font scaling, safe areas, keyboard, touch target, accessibility tree နဲ့ iOS/Android behavior ကွာခြားမှုတို့ပါသော native UI contract အဖြစ်နားလည်ပါ။

Mental Model
  1. Device behavior
  2. Measure + verify
  3. Smooth accessible UI

Responsive, Edge-to-Edge & Accessible UI ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်

အဓိက Syntax / Pattern

tsx
import { Text, useWindowDimensions, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

export function Dashboard() {
  const { width, fontScale } = useWindowDimensions();
  const columns = width >= 720 ? 2 : 1;
  return <SafeAreaView style={{ flex: 1 }}>
    <View accessibilityRole="summary" style={{ flexDirection: columns === 2 ? 'row' : 'column' }}>
      <Text maxFontSizeMultiplier={2}>Width {Math.round(width)} · font {fontScale}</Text>
    </View>
  </SafeAreaView>;
}

Responsive, Edge-to-Edge & Accessible UI ကို screen တစ်ခုအတွက် style syntax အဖြစ်သာမမြင်ဘဲ Yoga constraints, pixel density, font scaling, safe areas, keyboard, touch target, accessibility tree နဲ့ iOS/Android behavior ကွာခြားမှုတို့ပါသော native UI contract အဖြစ်နားလည်ပါ။

Code ကို အဆင့်လိုက်ဖတ်မယ်

  1. Device behaviorimport { Text, useWindowDimensions, View } from 'reac...

    Responsive, Edge-to-Edge & Accessible UI ကို screen တစ်ခုအတွက် style syntax အဖြစ်သာမမြင်ဘဲ Yoga constraints, pixel density, font scaling, safe areas, keyboard, touch target, accessibility tree နဲ့ iOS/Android behavior ကွာခြားမှုတို့ပါသော native UI contract အဖြစ်နားလည်ပါ။

  2. Measure + verifyreturn <SafeAreaView style={{ flex: 1 }}>

    Responsive, Edge-to-Edge & Accessible UI ကို screen တစ်ခုအတွက် style syntax အဖြစ်သာမမြင်ဘဲ Yoga constraints, pixel density, font scaling, safe areas, keyboard, touch target, accessibility tree နဲ့ iOS/Android behavior ကွာခြားမှုတို့ပါသော native UI contract အဖြစ်နားလည်ပါ။

  3. Smooth accessible UI}

    Responsive, Edge-to-Edge & Accessible UI example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

Execution Flow
  1. Device behavior
  2. Measure + verify
  3. Smooth accessible UI

Success

Responsive, Edge-to-Edge & Accessible UI ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်

Failure

Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။

Responsive, Edge-to-Edge & Accessible UI ကို screen တစ်ခုအတွက် style syntax အဖြစ်သာမမြင်ဘဲ Yoga constraints, pixel density, font scaling, safe areas, keyboard, touch target, accessibility tree နဲ့ iOS/Android behavior ကွာခြားမှုတို့ပါသော native UI contract အဖြစ်နားလည်ပါ။

tsx
import { Text, useWindowDimensions, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

export function Dashboard() {
  const { width, fontScale } = useWindowDimensions();
  const columns = width >= 720 ? 2 : 1;
  return <SafeAreaView style={{ flex: 1 }}>
    <View accessibilityRole="summary" style={{ flexDirection: columns === 2 ? 'row' : 'column' }}>
      <Text maxFontSizeMultiplier={2}>Width {Math.round(width)} · font {fontScale}</Text>
    </View>
  </SafeAreaView>;
}
You should see
Layout က width, safe-area insets နဲ့ larger text အလိုက်ပြောင်းမည်။

Real-world usage

လက်တွေ့ Project မှာ ဘယ်လိုသုံးမလဲ

Responsive, Edge-to-Edge & Accessible UI example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

Mini challenge

ကိုယ်တိုင်တည်ဆောက်ကြည့်ပါ

Responsive, Edge-to-Edge & Accessible UI example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

  • Example ကို copy မလုပ်ဘဲ ပြန်ရေးပါ
  • Normal input နဲ့ edge case စမ်းပါ
  • Run မလုပ်မီ compiler/output result ကိုခန့်မှန်းပါ
tsx
import { Text, useWindowDimensions, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

export function Dashboard() {
  const { width, fontScale } = useWindowDimensions();
  const columns = width >= 720 ? 2 : 1;
  return <SafeAreaView style={{ flex: 1 }}>
    <View accessibilityRole="summary" style={{ flexDirection: columns === 2 ? 'row' : 'column' }}>
      <Text maxFontSizeMultiplier={2}>Width {Math.round(width)} · font {fontScale}</Text>
    </View>
  </SafeAreaView>;
}

ရလဒ်: Responsive, Edge-to-Edge & Accessible UI ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်

အရိပ်အမြွက် ကြည့်ရန်

Responsive, Edge-to-Edge & Accessible UI example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

Quick Quiz 1 / 3

Responsive, Edge-to-Edge & Accessible UI ရဲ့ အဓိကသဘောတရားက ဘာလဲ။

Quick Quiz 2 / 3

ဘယ်အမှားကို အရင်ဆုံးရှောင်သင့်လဲ။

Quick Quiz 3 / 3

Real project မှာ ဘယ်လိုအသုံးချသင့်လဲ။

ဒီသင်ခန်းစာမှာ မှတ်ထားရမယ့်အချက်များ

  • Device behavior → Measure + verify → Smooth accessible UI
  • Responsive, Edge-to-Edge & Accessible UI ကို screen တစ်ခုအတွက် style syntax အဖြစ်သာမမြင်ဘဲ Yoga constraints, pixel density, font scaling, safe areas, keyboard, touch target, accessibility tree နဲ့ iOS/Android behavior ကွာခြားမှုတို့ပါသော native UI contract အဖြစ်နားလည်ပါ။
  • Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
  • Responsive, Edge-to-Edge & Accessible UI example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

Accessibility — React Native

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
  • Web CSS/DOM assumptions ကို React Native တွင်တိုက်ရိုက်သုံးခြင်း၊ subscription မပိတ်ခြင်း သို့ platform differences ကို condition အများကြီးဖြင့် component ထဲရောထည့်ခြင်း။

လက်တွေ့လေ့ကျင့်ခန်း

Responsive, Edge-to-Edge & Accessible UI example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

အလုပ်ဖြစ်ကြောင်း ဒီလိုသိမယ်: Layout က width, safe-area insets နဲ့ larger text အလိုက်ပြောင်းမည်။

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Responsive, Edge-to-Edge & Accessible UI | Thuta Learning