AnkiPro / react-native-window-resize

React Native window resizer for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@ankipro/react-native-window-resize

React Native library to resize app window on iOS. This library is mainly needed to quickly change the screen resolution by simulating different devices without having to open several simulators to test different resolution-dependent functions on the same device.

example

Installation

yarn add @ankipro/react-native-window-resize

install pods

npx pod-install

Usage

import WindowResizer from '@ankipro/react-native-window-resize';

// ...

WindowResizer.resizeToDefault();

WindowResizer.resizeTo(deviceModel);

WindowResizer.getAvailableDeviceModels((deviceModels) => ...)

For more information see example.

Methods

Name Type Description
.getAvailableDeviceModels() onComplete: (deviceModels: Array<DeviceModel>) => void Get a list of device dimensions that are smaller than the current device
.resizeTo() (deviceModelName: string) => void Resize to 'deviceModelName' device
.resizeToDefault() () => void Reset to initial window size

Types

type DeviceModel = {
  name: string;
  width: number;
  height: number;
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

About

React Native window resizer for iOS

License:MIT License


Languages

Language:Swift 24.6%Language:TypeScript 22.5%Language:Ruby 20.5%Language:Objective-C 13.5%Language:JavaScript 11.9%Language:Objective-C++ 6.4%Language:C 0.6%