Thuta Learning
React Native
IntermediateMobile Developmentintermediate

Responsive, Edge-to-Edge & Accessible UI

React Nativeသင်ခန်းစာ 16

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

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

ပိုပြီးနားလည်ထားရမယ့် အချက်

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 အဖြစ်နားလည်ပါ။

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

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 ကိုလိုအပ်သလိုအသုံးပြုပါ။

ဒီသင်ခန်းစာပြီးရင်

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 အလိုက်ပြောင်းမည်။

ကိုယ်တိုင်စမ်းကြည့်ရန်

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 ကိုလိုအပ်သလိုအသုံးပြုပါ။

Platform/Lifecycle သတိပေးချက်

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

AccessibilityReact 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 ကိုလိုအပ်သလိုအသုံးပြုပါ။

You'll know it worked when: Layout က width, safe-area insets နဲ့ larger text အလိုက်ပြောင်းမည်။

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