The problem is that a parent View in Android will clip the content of children Views (react-native)
This solves the problem of Overflow on Android (check this facebook/react-native#16951)
This could make code simpler, so you don't need to move some Components outside parents to make layout work
You can read more about the motivation and this package here https://medium.com/@sibelius/solving-view-overflow-in-android-reactnative-f961752a75cd
$ npm install react-native-view-overflow --save
$ react-native link react-native-view-overflow
import ViewOverflow from 'react-native-view-overflow';
<ViewOverflow>
<ComponentToEnableOverflow />
</ViewOverflow>
via CocoaPods:
- Open comand line in your project IOS folder, and run command
pod install
. - Run your project (
Cmd+R
)
or via Libraries:
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-view-overflow
and addRNViewOverflow.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNViewOverflow.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNViewOverflowPackage;
to the imports at the top of the file - Add
new RNViewOverflowPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-view-overflow' project(':react-native-view-overflow').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-view-overflow/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-view-overflow')
- In Visual Studio add the
RNViewOverflow.sln
innode_modules/react-native-view-overflow/windows/RNViewOverflow.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using View.Overflow.RNViewOverflow;
to the usings at the top of the file - Add
new RNViewOverflowPackage()
to theList<IReactPackage>
returned by thePackages
method