Questions tagged [react-native-stylesheet]

React Native Stylesheets provide styling capabilities similar to CSS stylesheets. Use this tag for questions about working with React Native Stylesheets or styling React Native code in general.

React Native Stylesheets provide styling capabilities similar to CSS stylesheets.

See https://reactnative.dev/docs/stylesheet.html for more info.

210 questions
1
vote
1 answer

react native app has different style in ios and android

The same code results in different styles in ios and android. The android version is the one that it should look like, but the same in ios looks totally destroyed. This app is already developed but never run on ios, probably they did not need that.…
Amir-Mousavi
  • 4,273
  • 12
  • 70
  • 123
1
vote
1 answer

React Native Reusable Card Component won't Visualize as expected

Hello there I'm new to react native. I'm trying to create reusable component, not only card component, maybe in future will create other reusable components. Below is the code example of reusable card component that I've created: Card.js import…
1
vote
1 answer

React Native: is it possible to make a component and all its children disappear?

In my React Native app I have a with several other elements nested inside it. Normally if I want to make a component disappear, I make its height go to 0, make its opacity 0, etc. But I want a universal way to apply a style to the and…
gkeenley
  • 6,088
  • 8
  • 54
  • 129
1
vote
0 answers

Flex dynamically when orientation changes (flip device)

I'm not ready to lock my app in portrait mode yet, not until I'm sure we can't figure this out. There once was a container called SwipeListView. It's a third party package, if you don't know it you can check this snack:…
DerpyNerd
  • 4,743
  • 7
  • 41
  • 92
1
vote
1 answer

How to vertically and horizontally align child components 'on top' of parent in React Native?

I'm having a lot of trouble getting two child components to vertically and horizontally align 'on top' of their parent element in React Native. I am trying to place Loader and Button on top of RTCView. I currently have this JSX returning in the…
Mr. Robot
  • 1,334
  • 6
  • 27
  • 79
1
vote
2 answers

React Native: Unable to center Text in View component

I am unable to center a Text component in a View component in React Native both on android as well as ios. As you can see the + sign in not centred in the white circle. This is my component:
1
vote
2 answers

I can't figure out why borderRadius is not working on a flatList component

I am making a chat in react native that is done by using a FlatList component to display the messages. I'm trying to style the messages so they are round but the borderRadius isn't working (Left, Right, Top or Bottom). I found this: borderRadius not…
user11530349
1
vote
1 answer

Overriding a Single Style Prop from Stylesheet Using React Native

With React Native, I'm looking to use StyleSheet to define a style and then use that style in numerous components, but I would like to change or override individual props for a few components. For example, a stack of 10 views with 5 different colors…
SunnyNonsense
  • 410
  • 3
  • 22
1
vote
1 answer

React Native (Expo) TextInput : style changes when selecting a suggestion provided by Android

Looking for a solution for this problem since 2 days and the internet didn't provide me with a solution for the first time of my life, so this is my first post on StackOverflow :) So, I'm building a react-native (0.59.8) app with Expo (3.4.1),…
1
vote
1 answer

Adding items into n column grids using flex

I am trying to create a list of items which looks similar to the below image. Currently I am creating a RowComponent and including ItemContainer component inside to create the mentioned effect. const styles = StyleSheet.create({ containerStyle: { …
1
vote
2 answers

How to align View component to left and right equally in react-native

I am building a cross platform mobile application using react-native. I am implementing a functionality where I am displaying the data in Accordion. I want the data to be aligned to the left and right in the Accordion Header and Accordion Body but I…
techie_questie
  • 1,434
  • 4
  • 29
  • 53
1
vote
1 answer

React Native Color Style

Here I have attached one image. That bar has a dark and light blue color mix according to image.how can I achieve that task?
Rajitha Perera
  • 1,581
  • 5
  • 26
  • 42
1
vote
1 answer

How to call AppRegistry.registerComponent with some delay

I need to read some user settings before App initialize. This settings will update the style of the app. I called AppRegistry.registerComponent with some delayed but app crashed. Have found this issue on…
Aaditya Paliwal
  • 607
  • 1
  • 5
  • 17
1
vote
3 answers

Keeping view size proportional

I have a container View and it has a static height, lets say 50: container: { width: '100%', height: 50, } Now this container has one child, that takes the whole parent's height, by setting its height to 100%: child: { height: 100%, } I…
Ivan Chernykh
  • 41,617
  • 13
  • 134
  • 146
0
votes
2 answers

maxWidth and maxHeight don't work as they should in React Native

I have the following code in react native: import { useState, useEffect } from 'react'; import { View, Text, Image, StyleSheet, Pressable } from 'react-native'; import * as colors from '../colors/index'; //Other imports.. const Message = ({ item,…