0

I am attaching two images, one showing the current view and other showing the view that i want it to be.

This is my Current View

This View i want to implement

You can see in the above images, in the first image, the highlighted area is a rectangle whereas in the second one, it is a rounded rectangle. I want to achieve second style , but i am not able to do.

The highlighted area is actually the result of TouchableNativeFeedback Component in React Native

Please guide me to achieve this

Code snippet is mentioned below :-

<View style={styles.chatDetailsScreenActionBar}>
   <View style={styles.chatDetailsScreenBackButtonView}>
       <TouchableNativeFeedback>
           <View style={styles.chatDetailsScreenBackButton}>
               <MaterialIcons name="arrow-back" size={30} color="white" />
               <Image source={{ uri: this.state.selectedChat.chat_thumbnail }} 
                          style={styles.chatDetailsScreenBackButtonImage} />
           </View>
       </TouchableNativeFeedback>
   </View>
</View>

Styles code for above Layout :-

chatDetailsScreenActionBar: {
        height: 70,
        backgroundColor: '#006156',
        justifyContent: 'center',
        paddingHorizontal: 10
    },
    chatDetailsScreenBackButtonView: {
        height: 55,
        width: 70,
        borderRadius: 24
    },
    chatDetailsScreenBackButton: {
        flexDirection: 'row',
        alignItems: 'center',
        height: "100%"
    },
    chatDetailsScreenBackButtonImage: {
        height: 36,
        width: 36,
        borderRadius: 18
    }

2 Answers2

0

Try to give the 'TouchableNativeFeedback' component style { borderRadius: 1000 }

D10S
  • 1,468
  • 2
  • 7
  • 13
0

try this : <TouchableNativeFeedback style={styles.TNF} > '...your code' </TouchableNativeFeedback>

TNF:{ width: ... , height: ... , backgroundColor:'#...' , borderRadius:50}

adil stifi
  • 65
  • 3
  • 8