Skip to content
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

Border not scaling on Android 7.0 #18208

Closed
KirinHorse opened this issue Mar 6, 2018 · 10 comments
Closed

Border not scaling on Android 7.0 #18208

KirinHorse opened this issue Mar 6, 2018 · 10 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.

Comments

@KirinHorse
Copy link

KirinHorse commented Mar 6, 2018

Border not scaling on Android 7.0 in RN [0.51 - 0.54]

Environment

Environment:
OS: Windows 10
Node: 9.5.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.54.0 => 0.54.0

Expected Behavior

image

Actual Behavior

image

Steps to Reproduce

import React, {Component} from 'react';
import {StyleSheet, Text, View} from 'react-native';

export default class TestScreen extends Component {
    render() {
        return (
            <View style={styles.container}>
                <View style={[styles.bg, {transform: [{scale: 0.5}]}]}>
                    <Text style={styles.text}>Scaled by 0.5</Text>
                </View>
                <View style={[styles.bg, {transform: [{scale: 1}]}]}>
                    <Text style={styles.text}>Scaled by 1</Text>
                </View>
                <View style={[styles.bg, {transform: [{scale: 2}]}]}>
                    <Text style={styles.text}>Scaled by 2</Text>
                </View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        alignItems: 'center',
        justifyContent: 'center',
        flex: 1
    },
    bg: {
        backgroundColor: 'orange',
        borderRadius: 5,
        borderWidth: 5,
        borderColor: 'red',
        width: 300,
        height: 80,
        margin: 30
    },
    text: {
        fontSize: 20
    }
});

Be sure the android version is 7.0 and react-native version is above 0.51.

I just test it on Android 4.4, and it workd well, but not on Android 7.0.
I did not test on other Android devices.

@KirinHorse KirinHorse changed the title Border not scalling on Android 7.0 Border not scaling on Android 7.0 Mar 6, 2018
@kelset kelset added the Android label Mar 6, 2018
@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest stable release?

Thank you for your contributions.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Old Version Ran Commands One of our bots successfully processed a command. labels Mar 7, 2018
@KirinHorse
Copy link
Author

@react-native-bot It appears in RN 0.51 - 0.54.

@filbertteo
Copy link

I'm encountering this issue as well. It's already been reported in #17224, but no one followed up with a fix, so it was closed by @react-native-bot. Hope someone will come up with a fix this time round.

@VinceBT
Copy link

VinceBT commented Mar 11, 2018

Getting this issue on 0.54.0 too
Also, setting borderRadius to 99999 is not working anymore.

@Elf2707
Copy link

Elf2707 commented Mar 13, 2018

Having the same issue on RN 0.53.3 scale not working on devices and simulators with Android 7.0.0 if View style has borderRadius property.

@react-native-bot react-native-bot added Android Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@hramos
Copy link
Contributor

hramos commented Jun 13, 2018

Can you verify if this still occurs on 0.56.0-rc?

@Fsarmento
Copy link

Fsarmento commented Sep 6, 2018

I am still having this exact same issue on 0.56. it only happens when borderRadius is set to a value bigger than 0.

react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0

I made a simple example on expo snack here. Scan the QR code with an Android 7.0 phone to reproduce the bug.

Edit

After playing with the expo snack example, I realized this issue only aplies to View components. Image componants can render the border correctly scaled.

@nicollecastrog
Copy link

I'm also still having issues with this on 0.56, details in this issue

@yaronlevi

This comment has been minimized.

@filbertteo
Copy link

I'm currently using RN 0.57.0, and after testing, I can confirm that it's been fixed for Android 7.0 (tested on emulator) and 8.0 (tested on both emulator and physical device). Try updating your RN to the latest version to see if it works for you :)

@hramos hramos closed this as completed Sep 25, 2018
@hramos hramos added the Resolution: Fixed A PR that fixes this issue has been merged. label Sep 25, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Sep 25, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests