Skip to content

Commit 490c296

Browse files
authored
Merge pull request #312 from vitorreis/patch-1
Add troubleshooting streched/distorted image
2 parents c9e090b + 4443b42 commit 490c296

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ A splash screen API for react-native which can programatically hide and show the
1212

1313
## Content
1414

15+
- [Changes](#changes)
1516
- [Installation](#installation)
1617
- [Examples](#examples)
1718
- [Getting started](#getting-started)
1819
- [API](#api)
1920
- [Testing](#testing)
21+
- [Troubleshooting](#troubleshooting)
2022
- [Contribution](#contribution)
21-
- [Changes](#changes)
23+
2224

2325
## Changes
2426
For React Native >= 0.47.0 use [v3.+](https://github.com/crazycodeboy/react-native-splash-screen/releases), for React Native < 0.47.0 use [v2.1.0](https://github.com/crazycodeboy/react-native-splash-screen/releases/tag/v1.0.9)
@@ -283,6 +285,28 @@ export default {
283285
}
284286
```
285287

288+
## Troubleshooting
289+
290+
### Splash screen always appears stretched/distorted
291+
Add the ImageView with a scaleType in the `launch_screen.xml`, e.g.:
292+
```
293+
<?xml version="1.0" encoding="utf-8"?>
294+
<FrameLayout
295+
xmlns:android="http://schemas.android.com/apk/res/android"
296+
android:layout_width="match_parent"
297+
android:layout_height="match_parent"
298+
android:orientation="vertical"
299+
>
300+
<ImageView
301+
android:src="@drawable/launch_screen"
302+
android:layout_width="match_parent"
303+
android:layout_height="match_parent"
304+
android:scaleType="centerCrop"
305+
>
306+
</ImageView>
307+
</FrameLayout>
308+
```
309+
286310
## Contribution
287311

288312
Issues are welcome. Please add a screenshot of you bug and a code snippet. Quickest way to solve issue is to reproduce it in one of the examples.

0 commit comments

Comments
 (0)