-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] setClipChildren doesn't seems to resolve overflow #16951
Comments
I'm closing this issue... @sibelius did the trick: ViewWithoutOverflowLayout.javapublic class ViewWithoutOverflowLayout extends ReactViewGroup {
public ViewWithoutOverflowLayout(Context context) {
super(context);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
try {
((ViewGroup) getParent()).setClipChildren(false);
} catch (Exception e) {
e.printStackTrace();
}
}
} |
Unfortunately, views that draw outside the parent does't seem to react to touch input |
@felippepuhle Would you be willing to formally release this as a component via npm for those of us less comfortable working with Android codebases? |
any workaround regarding this? @Kebabpizza I realised that's a real bummer because imagine I have dropdown coming from |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
OS: macOS High Sierra 10.13.1
Node: 6.10.3
Yarn: 1.2.1
npm: 3.10.10
Watchman: 4.7.0
Xcode: Xcode 9.1 Build version 9B55
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.3 => 0.50.3
Target Platform: Android
Steps to Reproduce
setClipChildren
on Android, ex:ViewWithoutOverflow
ViewWithoutOverflow
as wrapper and specifying some width/heightView
inside with position absolute and greater widthExpected Behavior
Lately, we're having some troubles with overflow on Android devices (as expected). I was able to fix it adding
<item name="android:clipChildren">false</item>
onsrc/main/res/values/styles.xml
:That was terrible: my animations started to show a very bad FPS. So, I decided to create a native component that handles this, and use only in some places... but I couldn't make it work yet.
Can I get the same result presented changing
styles.xml
withsetClipChildren
on a custom native component?Actual Behavior
With the native component(
ViewWithoutOverflow
) theoverflow: hidden
still stands.Reproducible Demo
ViewWithoutOverflowPackage.java
ViewWithoutOverflowManager.java
ViewWithoutOverflowLayout.java
ViewWithoutOverflow.android.js
DemoScreen.js
The text was updated successfully, but these errors were encountered: