简体   繁体   English

我尝试将文本组件发送到屏幕末端,但是它不起作用

[英]I tried to send text component to end of screen but it doesnt work

I have 2 text elements in a text element. 我在一个文本元素中有2个文本元素。 I tried to send second text element to the end but I couldn't do that how can I do it ? 我尝试将第二个文本元素发送到末尾,但我不能这样做,该怎么办?

<Text style={[styles.text2, item.Ccolor == 'MAVI' ? {color:'rgba(14, 110, 172, 1)'}: {color:'#f7b731'},{position:'relative'}]}
                    animation={isActive ? 'bounceIn' : undefined}>
    <Text style={{textAlign:'left'}}> {item.Beyanname} </Text>
    <Text style={{position:'absolute',right:0}}> {item.Gumruk} </Text> 
</Text> 

From the React Native documentation, the Text component does not have a position prop. 从React Native文档中, Text组件没有position属性。

Text Style Props 文字样式道具

Try using a View instead, but do note, you cannot use a View within a Text . 尝试改用View ,但要注意,您不能在Text使用View

<View style={{position:'absolute',right:0}}>
   <Text>{item.Gumruk}</Text>
</View>

如何从 react-router-dom 设置 {Switch} 组件的样式? 我试着用<div>并且不工作</div><div id="text_translate"><p><a href="https://i.stack.imgur.com/4piCG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4piCG.jpg" alt="在此处输入图像描述"></a></p><p> <a href="https://i.stack.imgur.com/CyQH3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CyQH3.jpg" alt="在此处输入图像描述"></a></p><p> 我在下面有这段代码,并尝试更改 map 组件样式。 但是,它看起来像是来自 Switch 组件。 我怎样才能使屏幕适合这里的“根”元素? 我使用或来自 MUI 的容器和其他东西来调整大小,但它们都不起作用。</p><pre> &lt;MainWrapper&gt; &lt;Visible when={isLogged}&gt; &lt;LeftPanel /&gt; &lt;/Visible&gt; &lt;div style={{width: '100%'}}&gt; &lt;Visible when={isLogged}&gt; &lt;Navbar /&gt; &lt;/Visible&gt; &lt;div style={{height: '100hv'}}&gt; &lt;Switch&gt; &lt;PrivateRouter path='/map' component={MapPage} isLogged={isLogged} redirectTo={'/login'} /&gt; &lt;PrivateRouter path='/profile' component={UserProfile} isLogged={isLogged} redirectTo={'/login'} /&gt; &lt;PrivateRouter path='/login' component={Login} isLogged={;isLogged} redirectTo={'/map'} /&gt; &lt;PrivateRouter path='/registration' component={Registration} isLogged={.isLogged} redirectTo={'/map'} /&gt; &lt;PrivateRouter path='/' component={{}} isLogged={false} redirectTo={'/login'} /&gt; &lt;/Switch&gt; &lt;/div&gt; &lt;/div&gt; &lt;/MainWrapper&gt; ): } } const MainWrapper = styled;div` height: 100vh; display; flex; `;</pre></div> - How to style {Switch} component from react-router-dom? I tried wrapping it with <div> and does not work

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Express不会发送结束响应 - Express doesnt send the end response 我尝试了serialize()但似乎没有用? 我究竟做错了什么? - I tried serialize() but doesnt seem to work ? what am I doing wrong? 我无法对数组中的数字进行排序(尝试了此处编写的所有内容,stil无法正常工作) - I can't sort numbers in an array (tried everything that was written here, stil doesnt work) 我试图用输入增加和减少数字来制作一个简单有趣的系统,但它不起作用 - I tried to make a simple fun system with increasing and decreasing numbers with input, but it doesnt work 尝试在功能结束时将0切换为1,但是它不起作用 - Trying to switch 0 for 1 in the end of the function but it doesnt work 如何从 react-router-dom 设置 {Switch} 组件的样式? 我试着用<div>并且不工作</div><div id="text_translate"><p><a href="https://i.stack.imgur.com/4piCG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4piCG.jpg" alt="在此处输入图像描述"></a></p><p> <a href="https://i.stack.imgur.com/CyQH3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CyQH3.jpg" alt="在此处输入图像描述"></a></p><p> 我在下面有这段代码,并尝试更改 map 组件样式。 但是,它看起来像是来自 Switch 组件。 我怎样才能使屏幕适合这里的“根”元素? 我使用或来自 MUI 的容器和其他东西来调整大小,但它们都不起作用。</p><pre> &lt;MainWrapper&gt; &lt;Visible when={isLogged}&gt; &lt;LeftPanel /&gt; &lt;/Visible&gt; &lt;div style={{width: '100%'}}&gt; &lt;Visible when={isLogged}&gt; &lt;Navbar /&gt; &lt;/Visible&gt; &lt;div style={{height: '100hv'}}&gt; &lt;Switch&gt; &lt;PrivateRouter path='/map' component={MapPage} isLogged={isLogged} redirectTo={'/login'} /&gt; &lt;PrivateRouter path='/profile' component={UserProfile} isLogged={isLogged} redirectTo={'/login'} /&gt; &lt;PrivateRouter path='/login' component={Login} isLogged={;isLogged} redirectTo={'/map'} /&gt; &lt;PrivateRouter path='/registration' component={Registration} isLogged={.isLogged} redirectTo={'/map'} /&gt; &lt;PrivateRouter path='/' component={{}} isLogged={false} redirectTo={'/login'} /&gt; &lt;/Switch&gt; &lt;/div&gt; &lt;/div&gt; &lt;/MainWrapper&gt; ): } } const MainWrapper = styled;div` height: 100vh; display; flex; `;</pre></div> - How to style {Switch} component from react-router-dom? I tried wrapping it with <div> and does not work 屏幕导航不适用于Params React导航 - Screen Navigation doesnt work with Params React Navigation API 调用 ReactJs 组件不起作用 - API call with ReactJs Component doesnt work 更新组件后Javascript不起作用 - Javascript doesnt work after updating component Kube JS Modal组件关闭不起作用 - Kube js Modal component close doesnt work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM