239 questions
0
votes
0
answers
39
views
React Native: How to keep footer buttons pinned above SafeArea + fixed padding while parent container height is dynamic?
I’m working on a React Native layout where:
The parent container’s height changes dynamically (based on user settings or API values).
Inside the parent, I need to keep some content at the top and a ...
0
votes
1
answer
37
views
React Native Flatlist not rendering on expoGo, but fine on web
I'm not quite sure what is happening but I can't seem to get a Flatlist to render anything in expoGo. It renders fine in the webview but not on my device or a virtual device either. The code is rather ...
0
votes
0
answers
265
views
`react-native-gifted-charts` How to create a responsive horizontal bar chart using?
Description
I'm using react-native-gifted-charts to create a horizontal bar chart in my React Native app, and it works great for basic setups. However, I'm facing issues with responsiveness and layout ...
1
vote
2
answers
61
views
How to style nested elements in React Native Stylesheet?
In JSS for React, you can style elements within other elements like this:
nav: {
fontSize: 24,
display: 'flex',
flexDirection: 'row',
color: '#fff',
marginTop: 24,
marginLeft: 16,
'&...
1
vote
0
answers
827
views
Tailwind NativeWind styles not working in react native screens inside navigation
I am a beginner at react native and creating a project using reactnative cli. However I'd like to use tailwindcss inside my project for styling. I came across NativeWind and been trying to set it up ...
1
vote
2
answers
2k
views
How to Create an Inner Shadow Effect Similar to box-shadow: inset in React Native?
I'm new to React Native and using Expo to build a mobile app. I'm trying to create a design with an inner background shadow effect that makes it appear curved, similar to how I'd achieve it on the web ...
-1
votes
2
answers
161
views
How to fix "Transform with key of translateY must be a number" error in React Native?
I'm trying to postion an element correctly using transform property,
but whenever i give percentage values it giving me an error
How can I fix this issue ?
Here is my code
import { Animated,Image,View}...
0
votes
0
answers
570
views
how do i apply nativewind/ tailwind styling across my entire react-native (expo) application?
i have been having issues where i cant see the theme that i have implemented for my react native expo project. I'm not sure what is causing the issue... for reference, no nativewind styling is showing....
0
votes
1
answer
392
views
KeyBoardAvoidingView not working as expected
I am using 'KeyBoardAvoidingView' to avoid the keyboard for an input element on my screen, which also contains an image.
The content pretty much occupies the screen and I want the content to scroll up ...
1
vote
1
answer
328
views
React Native Text Not Showing
import { StyleSheet, Text, View, Image } from 'react-native';
import React, { Component } from 'react';
interface AvatarProps {
fullName: string;
membership: string;
}
export default class ...
1
vote
1
answer
66
views
React Native - Flex
I have two components in a screen. One is an Image and other is a View.
I give flex:1 to main view and give flex:0.7 to image and flex:0.3 to view.
import { Image, StyleSheet, Text, View, ...
0
votes
1
answer
163
views
How to reset margins in react-native?
Still getting used to react-native styling. I noticed that resetting margins works slightly different from normal web. For the context I'm using react-native for web.
If you do the following
<View ...
1
vote
1
answer
42
views
React Native : Image on absolute position appears truncated on FlatList
I'm trying to render a DoctorCard component inside an horizontal Flatlist. The issue that the image that is on position:absolute inside the DoctorCard that i render inside Flatlist doesn’t appear as ...
-1
votes
1
answer
174
views
borderWidth : "transparent" , React Native Expo
i dont know why but for some reason when im applying border width style as "transparent" my expo app crashes immediately
<Pressable
style = {{borderWidth:"transparent"}}
>
......
1
vote
3
answers
185
views
The difference between View and ScrollView in styling
This is my component code and my style code:
function StartGameScreen() {
return (
<View style={styles.inputContainer}>
<TextInput
style={styles.numberInput}
...
0
votes
1
answer
73
views
Error cannot read property 'match' of undefined when using NeomorphFlex
I need to use more than 1 style into NeomorthFlex (from react-native-neomorph-shadows) and I'm doing it like this:
const styleuse = [
globalStyles.buttonContained,
{
backgroundColor: ...
0
votes
2
answers
362
views
How to reuse a style into same StyleSheet
I am using React Native, and I want to reuse a style within the same StyleSheet. My styles are as follows:
buttonContained: {
borderRadius: 8,
backgroundColor: Colors.primary,
...
0
votes
1
answer
235
views
React Native Change Background Color on Press
I created a FlatList in React Native.
The data is:
const Friends = [
{
id: 1,
name: 'Alex Lee',
profileImage: require("../Assets/FriendsImages/f1.png"),
...
0
votes
1
answer
61
views
React Native Component Position
I create a button component in react native. It is on the top side of screen but I want to set it at the end of screen.
<View style={{ marginHorizontal: 52, marginBottom: 23, }}>
...
1
vote
0
answers
118
views
Align text to right in the left align paragraph in React native
In React native
I want to make ui like above but get confused how to align Date to end when paragraph ends in react native. This is what I am trying so far.
<Text> Long para end <Text style={{...
1
vote
2
answers
393
views
React Native Container Styling
This is the container that I create looks:
This is the style I want.
How can I do this. The code is:
<View>
{
usersInfo.map((item) =>
<View key={item.id} style={{}}&...
1
vote
1
answer
6k
views
Make a dropdown list to select in TextInput
Im using react-native-paper which is a great library, but i ran into a problem when i needed a dropdown menu, that is overlay on the TextInput field around it.
Don't want to use any Library unless it ...
0
votes
1
answer
218
views
how to change background colour of border radius in react native using flex
I am using flex to design a react native page. I have used flex to design entire screen, my issue is I have created a radius for a menu style as in below code. how can I
function Home() {
return (
...
0
votes
1
answer
392
views
React Native StyleSheets Global Design Constants
I am wondering if there was some way to setup global design constants to use in React Native Stylesheets.
When I used styled components I was able to set-up something like
TextInput.tsx
import React ...
0
votes
1
answer
53
views
React Native inconsistent size of items in FlatList when using numColumns and margin
When the last row has 1 or 2 items when using numColumns={3} they are slightly bigger
const BookList = () => {
...
const renderItem = (item: any) => {
return (
<View style={...
1
vote
2
answers
982
views
React-Native TypeScript: error when passing in variable to stylesheet object
Here is the style I'm using and how I'm using it
style={styles.input(isPasswordSelected)}
const styles = StyleSheet.create({
input: (isPasswordSelected: boolean) => ({
height: 40,
...
0
votes
1
answer
41
views
React-native: how to vertical center Text and Image
In react native. I have a multiple lines text, and There will be a image at the end of the text.I want they can be vertical center, when they in same line。
now my code is not vertical center:like this
...
1
vote
2
answers
1k
views
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/...
0
votes
1
answer
69
views
Stacking Different View in React-Native Failed
I am attempting to implement a page in react-native with a Map component on the botton, and I am also trying to put a overlapping scroll view on top of the Map view without influencing the ...
0
votes
0
answers
35
views
The moment my text got bigger, my image flows out of its container - React Native
enter image description here
In my project I am building a Cart like component that will be rendered on the screen. Like the image given, the moment my text got larger, it pushes away my image and ...
1
vote
0
answers
759
views
React native styles management incorporating theme, global styles, component specific styles with props, inline styles i.e. one solution for all
I am getting hard time in styles management in react native.
BACKGROUND
Before using react navigation useTheme(), I had defined my color scheme and global styles like this
export const themeStyles = {
...
1
vote
2
answers
1k
views
What's the difference of using `array` vs `StyleSheet.compose()` in React Native
As per title:
What's the difference of these usages? I can see they all performing the same from UI perspective
import { StyleSheet, View } from 'react-native'
import type { JSX } from 'react'
const ...
0
votes
1
answer
312
views
React Native styling with multi language app using i18next
My problem is when I create a multi-language app in react native, for example, an app that can be in Arabic and English. when I want to style a component to change the direction when language is ...
0
votes
1
answer
158
views
How to style Text wrap in React Native
I have text like below,
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (xxxxxxxx)
and I have code like this:
<View
style={{
width: '77%',
justifyContent: 'flex-end',
flexDirection: '...
0
votes
1
answer
1k
views
ignore safe area in Absolute position child view in react native
I am trying to create overlay over the screen.
But the problem is child view i.e popup screen also have top and bottom safe area added.
I do not want to use this just for 1screen: https://www.npmjs....
0
votes
1
answer
315
views
React Native for Web: Invariant Violation: "cursor" is not a valid style property
We are using React Native for Web so we do need to be able to modify the cursor if it is in the web but I imagine since there is no cursor on mobile this is an issue with React Native.
How can we ...
1
vote
1
answer
905
views
React Native: Invalid prop `transform` of type `string` supplied, expected an array
We are using the CSS style transform/translate parameters but this is invalid for React Native typescript.
Invariant Violation: Invalid prop `transform` of type `string` supplied to `StyleSheet ...
0
votes
0
answers
321
views
styles with height auto react native not working
this is expected result-->
and this is my result -->
The colors are fine, that doesn't matter.
the problem is efectly in the line connector.
This is the code of is a reusable component.
...
1
vote
1
answer
167
views
How to add parameters to a React object?
I have a shared style with error:
export const modalStyle(height)= { // <-- Whats the syntax for adding parameter here?
width:MODAL_WIDTH,
height:height,
backgroundColor:...
3
votes
1
answer
71
views
Styles from one custom React Native component remove styles from another custom component
So I created 2 custom React Native components and imported them to my App.js file, but it seems that the styles from the 1st component are interfering with the styles from 2nd component. Both of these ...
0
votes
0
answers
231
views
How to add padding to all child elements in React Native
I'm trying to add styling to child components of a React Native View. Since you cant use the > * selector in React Native's StyleSheet.create function how do you achieve this result?
Here is the ...
0
votes
1
answer
44
views
View is not Displaying
i wanted to create a colored divider under the text but it does not show up on the screen and i don't know why
I'm using expo with react native
image
the divider should appear under text
return (
&...
-1
votes
1
answer
508
views
How to show an icon on last index of flat list
I'm trying to wrap my flat list and trying to show an Icon after last index of Flatlist. I had tried but it works fine on a single row. when we data goes to next row it would not work.
Here is my flat ...
-2
votes
1
answer
173
views
I want to improve my react native mobile applications design and css [closed]
How do I improve my CSS styling for react native to design mobile apps?
Can someone recommend courses, references or documents? anything will help
1
vote
1
answer
2k
views
How to give spacing between the content of view in react native?
I am new in react native,I have to view right and left container given flex-between them,
now I have to give space in contents of left and right container also.
image shown in the below diagram as ...
0
votes
0
answers
108
views
How to create navigation like this with CSS/React Native?
I would like to create a navigation with CSS/styled components for React Native (so no all styling hacks and attributes will work) that looks simmmiliar to this one that the Google Tasks app uses, see ...
0
votes
1
answer
59
views
How do I type a function inside the stylesheet in React Native CLI?
import { StyleSheet, TextStyle, ViewStyle, ImageStyle } from 'react-native';
export const styles = StyleSheet.create({
spacing: (marginBottom: number) => {
return {
...
0
votes
2
answers
35
views
How to achieve the desired UI in react native
I am trying to acheive a styling as shown in the image attached below
See how here the fingerprint icon happens to be inside the border of the Textinput field but instead I am getting the output as ...
0
votes
2
answers
1k
views
How to make a React Native TextInput change Opacity just like TouchableOpacity?
My code looks something like this currently:
<View>
<TextInput placeholder='PlaceholderText'>
</TextInput>
</View>
I want to make a TextInput component that has an ...
1
vote
4
answers
425
views
alignItems = "flex-end" not working with onContentSizeChange
I am trying to fix the corner icons to the bottom of the screen regardless the expansion of the text area. I tried with position=absolute and bottom = 0 but it got hidden behind my textArea.
Here is ...