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

Not Working in Android. #808

Closed
sukumardv3101 opened this issue Dec 26, 2017 · 11 comments
Closed

Not Working in Android. #808

sukumardv3101 opened this issue Dec 26, 2017 · 11 comments

Comments

@sukumardv3101
Copy link

sukumardv3101 commented Dec 26, 2017

Here is my code:
<ScrollView
bounces={false}
removeClippedSubviews={true}
style={{alignSelf:'stretch'}}>

<ScrollableTabView
initialPage={0}
onChangeTab={(i,ref) => console.log(i)}>




@sukumardv3101
Copy link
Author

Inside ScrollView scrollable tabbar is Not working in android but it was working fine in ios. It was showing all state changes.

@kkotkkio
Copy link

kkotkkio commented Jan 9, 2018

+1

1 similar comment
@TareqElMasriDev
Copy link

+1

@jiyarong
Copy link

me too

1 similar comment
@basilbai
Copy link

me too

@msannikov
Copy link

+1

1 similar comment
@ak-paca
Copy link

ak-paca commented Feb 21, 2018

+1

@msannikov
Copy link

Can be fixed with this pull request #797
@skv-headless is there any chance to get this PR in anytime soon? Thanks!

@kadanes
Copy link

kadanes commented Jan 25, 2019

I am still facing this issue.

My code:

     <SafeAreaView style={styles.container}>

              <ButtonGroup
                   onPress={(index) => {this.setState({selectedIndex:index})}}
                   selectedIndex={this.state.selectedIndex}
                   buttons={headerButtonNames}
                   buttonStyle={styles.buttonStyle}
                   selectedButtonStyle={styles.selectedButtonStyle}
                   textStyle={styles.buttonTextStyle}
                   selectedTextStyle={styles.selectedButtonTextStyle}
                   containerStyle = {{marginLeft: 0, marginRight: 0}}
               />
               <Text>
                   Called From: {this.props.navigation.getParam('calledFrom', 'No Source') }
               </Text>
               <ScreenName ScreenName={headerButtonNames[this.state.selectedIndex]}/>
               <ScrollableTabView
                       tabBarPosition = "top"
                       tabBarActiveTextColor = {Colors.GrayAccent}
                       scrollWithoutAnimation = {true}
                       tabBarUnderlineStyle = {styles.tabBarUnderline}
                   >
                   <RequestList tabLabel="Sub Requests" />
                   <ResponseTemplate tabLabel="Responses" />
               </ScrollableTabView>
           </SafeAreaView>   

It works well on iOS, but on Android, I get this:

screenshot_1548431847

@kadanes
Copy link

kadanes commented Jan 26, 2019

I am still facing this issue.

My code:

     <SafeAreaView style={styles.container}>

              <ButtonGroup
                   onPress={(index) => {this.setState({selectedIndex:index})}}
                   selectedIndex={this.state.selectedIndex}
                   buttons={headerButtonNames}
                   buttonStyle={styles.buttonStyle}
                   selectedButtonStyle={styles.selectedButtonStyle}
                   textStyle={styles.buttonTextStyle}
                   selectedTextStyle={styles.selectedButtonTextStyle}
                   containerStyle = {{marginLeft: 0, marginRight: 0}}
               />
               <Text>
                   Called From: {this.props.navigation.getParam('calledFrom', 'No Source') }
               </Text>
               <ScreenName ScreenName={headerButtonNames[this.state.selectedIndex]}/>
               <ScrollableTabView
                       tabBarPosition = "top"
                       tabBarActiveTextColor = {Colors.GrayAccent}
                       scrollWithoutAnimation = {true}
                       tabBarUnderlineStyle = {styles.tabBarUnderline}
                   >
                   <RequestList tabLabel="Sub Requests" />
                   <ResponseTemplate tabLabel="Responses" />
               </ScrollableTabView>
           </SafeAreaView>   

It works well on iOS, but on Android, I get this:

screenshot_1548431847

Okay it works now with the help of this:

<ScrollableTabView
                        tabBarPosition = "top"
                        tabBarActiveTextColor = {Colors.GrayAccent}
                        scrollWithoutAnimation = {true}
                        tabBarUnderlineStyle = {styles.tabBarUnderline}
                        style={styles.scrollableTabView}
>

                    <RequestList tabLabel="Sub Requests" navigation={this.props.navigation}/>
                    <ResponseTemplate tabLabel="Responses" navigation={this.props.navigation}/>

</ScrollableTabView>

.
.
.

let styles = StyleSheet.create({
    tabBarUnderline: {
        backgroundColor: Colors.GrayAccent
    },
    scrollableTabView: {
        flex: 1,
        width: "100%"
    }
})

Should probably include in the docs.

@HaManhTuan
Copy link

Chỉ là thuộc tính: width: '100%' là được

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

10 participants