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

Rendering problem on iOS 10 #10

Closed
junedomingo opened this issue Mar 7, 2017 · 21 comments
Closed

Rendering problem on iOS 10 #10

junedomingo opened this issue Mar 7, 2017 · 21 comments

Comments

@junedomingo
Copy link

56cc3012-5c8e-4e33-b589-7cd4f0009e73

Here you can see some shadow effect in the inactive tab.
this happens in actual device

@kirankalyan5
Copy link
Owner

@junedomingo can you share the code for the above ? It's working fine for me.

@junedomingo
Copy link
Author

Custom styles are inlined for now.

<SegmentedControlTab
	tabStyle={{ 
        backgroundColor: 'white', 
        marginTop: Platform.OS === 'ios' ? 15 : 10, 
        borderColor: '#163258', 
        marginBottom: 10 
    }}
	tabTextStyle={{ color: '#163258' }}
	activeTabStyle={{ backgroundColor: '#163258' }}
	values={['Schedules', 'Tasks']}
	selectedIndex={this.state.segmentedControlTabIndex}
	onTabPress={index => { this._filterSchedules(index); }}
/>

@junedomingo
Copy link
Author

@kirankalyan5, This is already in release build by the way, my iOS version is 10.2.
No problem in Simulator.

@whan
Copy link

whan commented Mar 14, 2017

I guess this is React Native bug on iOS, even this simple piece of codes will have the same issue:

text

@whan
Copy link

whan commented Mar 14, 2017

<TouchableOpacity > <View style={{ width: 100, borderBottomLeftRadius: 5, borderTopLeftRadius: 5, borderColor: 'blue', paddingHorizontal: 10, paddingVertical: 5, borderWidth: 1, }}> <Text style={{ width: 30 }}>text</Text> </View> </TouchableOpacity>

@asessa
Copy link
Contributor

asessa commented Mar 27, 2017

This glitch is visible only when your side border radius is greater than 0 and you have an element on its side with borders.

I've disabled the left/right border and works for me (iOS 10.2.1 device).

Try to disable the border left/right width on L51/52:

        const firstTabStyle = index === 0 ? [{ borderRightWidth: 0, borderTopLeftRadius: borderRadius, borderBottomLeftRadius: borderRadius }] : {}
        const lastTabStyle = index === values.length - 1 ? [{ borderLeftWidth: 0, borderTopRightRadius: borderRadius, borderBottomRightRadius: borderRadius }] : {}

@kirankalyan5 if it's ok for you I can submit a PR.

@kirankalyan5
Copy link
Owner

@here - I have published the latest version, have a look!

@asessa
Copy link
Contributor

asessa commented Apr 3, 2017

@kirankalyan5 I've tested with the latest version and the problem is still there

@giautm
Copy link
Contributor

giautm commented Jun 23, 2017

I still got that problem after upgrade to Expo's SDK 18.

@daltondanis
Copy link

daltondanis commented Jul 11, 2017

Still have this problem too

Example:

image

    let tank = 60 //can be higher or smaller

    rightTank: {
        borderTopLeftRadius: 40,
        borderBottomLeftRadius: 40,
        borderColor: 'black',
        borderTopWidth: 3,
        borderLeftWidth: 3,
        borderBottomWidth: 3,
        height: 120,
        width: window.width/tank - 50,
        justifyContent: 'center',
        alignItems: 'center',
    },
    middleTank: {
        borderColor: 'black',
        borderTopWidth: 3,
        borderBottomWidth: 3,
        borderLeftWidth: 3,
        height: 120,
        width: window.width/tank - 50,
        justifyContent: 'center',
        alignItems: 'center',
    },
    leftTank: {
        borderTopRightRadius: 40,
        borderBottomRightRadius: 40,
        borderColor: 'black',
        borderWidth: 3,
        height: 120,
        width: window.width/tank - 50,
        justifyContent: 'center',
        alignItems: 'center',
    },

EDIT:

Fixed it by doing this (??????)

image

    rightTank: {
        borderTopLeftRadius: 40,
        borderBottomLeftRadius: 40,
        borderColor: 'black',
        borderTopWidth: 3,
        borderLeftWidth: 3,
        borderBottomWidth: 3,
        height: 120,
        width: window.width/tank - 50,
        justifyContent: 'center',
        alignItems: 'center',
    },
    middleTank: {
        //marginRight: 0.5,
        //marginLeft: 0.5,
        borderColor: 'black',
        //borderTopWidth: 3,
        //borderBottomWidth: 3,
        //borderLeftWidth: 3,
        borderWidth: 3,
        height: 120,
        width: window.width/tank - 50,
        justifyContent: 'center',
        alignItems: 'center',
    },
    leftTank: {
        borderTopRightRadius: 40,
        borderBottomRightRadius: 40,
        borderColor: 'black',
        //borderWidth: 3,
        borderTopWidth: 3,
        borderBottomWidth: 3,
        borderRightWidth: 3,
        height: 120,
        width: window.width/tank- 50,
        justifyContent: 'center',
        alignItems: 'center',
    },

eqyiel added a commit to mango-chutney/react-native-segmented-control-tab that referenced this issue Jul 12, 2017
eqyiel added a commit to mango-chutney/react-native-segmented-control-tab that referenced this issue Jul 14, 2017
eqyiel added a commit to mango-chutney/react-native-segmented-control-tab that referenced this issue Jul 14, 2017
@kirankalyan5
Copy link
Owner

kirankalyan5 commented Jul 22, 2017

Hi Guys, I have fixed this issue, I have published the latest version have a look.
Attaching the screen shot for reference.

ios10

@kennykswan
Copy link

Note with this fix, if there are only two tabs, there is no border between them.

@kirankalyan5
Copy link
Owner

@kennykswan I agree, but when it's two tabs I don't find a need of border between them.
PFA
image

@jamesholcomb
Copy link

I tried the fix. With three tabs on Simulator, seeing some extra spacing between second and third tab when third tab is selected.

RN 0.46.4
iOS 10.3

image

@jamesholcomb
Copy link

This resolved it for me:

tabStyle={[
  tabStyle,
  index !== 0 && index !== values.length - 1
    ? { marginLeft: Platform.OS === "ios" ? -1 : 0 }
    : {}
]}

@MassieurHunter
Copy link

MassieurHunter commented Apr 6, 2018

hello guys,
commit f31e512 produces the same issue for ios 9 and 10 when there's only 2 tabs, rolling back to :
const firstTabStyle = [{ borderRightWidth: 0, borderTopLeftRadius: borderRadius, borderBottomLeftRadius: borderRadius }]
fixed the problem for me

@ajayveer1414
Copy link

Hi guys,
use following code to remove the shadow from SegmentedControlTab

                        <SegmentedControlTab
                            tabStyle={{
                                flex: 1, borderTopLeftRadius: 5,
                                borderTopRightRadius: 5,
                                borderBottomLeftRadius: 5,
                                borderBottomRightRadius: 5,
                            }}
                            values={['No', 'Yes',]}
                            selectedIndex={this.state.selectedIndex}
                            onTabPress={this._handleIndexChange}
                        />

@luigiquero
Copy link

luigiquero commented Oct 24, 2018

I got rid of the artefact in by using Math.round in borderRadius provided directly to SegmentedControlTab.

Apparently it doesn't like floats.

This is certainly an iOS-only problem

@hsparihar-systango
Copy link

hsparihar-systango commented Nov 5, 2018

@kirankalyan5 @junedomingo Still getting this issue in ios 6s device with 2 tabs.
screen shot 2018-11-05 at 8 02 29 pm

@GavinThomas1192
Copy link

GavinThomas1192 commented Dec 26, 2018

I'm also still getting this issue on ios 6s
image from ios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests