Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

swap scroll right in react native

scrollListToStart(contentWidth, contentHeight) {
    if (I18nManager.isRTL) {
        this.scrollView.scrollTo({x: contentWidth});
    }
}

render() {
    let containerStyle = I18nManager.isRTL ? styles.RTLContainer : styles.LTRContainer;

    return (
        <ScrollView
            ref={ref => this.scrollView = ref}
            onContentSizeChange={this.scrollListToStart.bind(this)}
            horizontal={true}
            style={[styles.buttonsContainer, containerStyle]}>
            {this.renderButtons()}
        </ScrollView>
    )
}


const styles = StyleSheet.create({

    RTLContainer: {
        flexDirection: 'row-reverse'
    },

    LTRContainer: {
        flexDirection: 'row'
    }
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript Set Difference Operation 
Javascript :: js map array to object 
Javascript :: how to install exact package lock version in package-lock.json 
Javascript :: angular infinite scroll 
Javascript :: json to pdf javascript 
Javascript :: modulus js 
Javascript :: classlist remove multiple classes 
Javascript :: how to get the uppert triangular matrix out of a matrix matlab 
Javascript :: vue js link image link in props doesnt work 
Javascript :: Setting axios base url dynamically 
Javascript :: onfocus 
Javascript :: javascript fetch APIjson 
Javascript :: remove suffix string js 
Javascript :: redux toolkit remove from array 
Javascript :: how to cause a whole page reload react redux 
Javascript :: jQuery DataTables Checkboxes 
Javascript :: get browser cookie 
Javascript :: passing argument to function handler functional compoent javascript react 
Javascript :: how to use buffer in angular by using browserify 
Javascript :: javascript set style attribute 
Javascript :: jsonb_set 
Javascript :: return inside ternary operator javascript 
Javascript :: how to count seconds in javascript 
Javascript :: how set type of string value to number in js 
Javascript :: sequelize transaction util 
Javascript :: javascript array sorting 
Javascript :: chnage classname of div 
Javascript :: onclose modal bootstrap 
Javascript :: jquery determine empty value radio by name 
Javascript :: see if array contains array javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =