簡體   English   中英

如何在反應原生中更改基於原生的 Picker fontSize 和 fontFamily?

[英]how to change native-base Picker fontSize and fontFamily in react native?

我的組件中有一個 Picker 有沒有辦法設置 fontSize 和 fontFamily? 我嘗試style={{fontFamily:'iransans',fontSize:14}}itemTextStyle={{fontFamily:'iransans',fontSize:14}}但它們都對我不起作用! ... 你有什么主意嗎?

<Picker
note
mode="dropdown"
style={{fontFamily:'iransans',fontSize:14 }}
itemTextStyle={{fontSize:16}} ...

`

<!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
                
                <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
                <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
        </style>

        <style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="android:textAlignment">gravity</item>
            <item name="android:gravity">start</item>
            <item name="android:fontFamily">@font/arab_font</item>

        </style>
        <style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="android:textAlignment">gravity</item>
            <item name="android:gravity">start</item>
            <item name="android:textColor">#000000</item>

        


        </style> 
`

即使我按照這里的文檔選擇器/字體系列,我也遇到了同樣的問題,字體系列不起作用???

<input>和<textarea></textarea>未在 native-base 中對齊,React Native&lt;/div&gt;<div id="text_translate"><p> 我想使用原生基礎將單行輸入和多行輸入放入表單中,但它們未正確對齊垂直線。 有什么我遺漏的或者不應該一起使用的嗎? 謝謝你。</p><p> package.json 的一部分</p><pre> "expo": "~37.0.3", "native-base": "2.13.8", "react": "~16.9.0", "react-dom": "~16.9.0", "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",</pre><p> 我的代碼</p><pre class="lang-js prettyprint-override"> &lt;Content padder&gt; &lt;Form&gt; &lt;Item regular floatingLabel&gt; &lt;Label style={{paddingTop: 2}}&gt;Label&lt;/Label&gt; &lt;Input onChangeText={url =&gt; setUrl(url)}/&gt; &lt;/Item&gt; &lt;Textarea rowSpan={5} onChangeText={content =&gt; setContent(content)} bordered placeholder="this is textarea" /&gt; &lt;/Form&gt; &lt;/Content&gt;</pre><p> <a href="https://i.stack.imgur.com/gSyge.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gSyge.png" alt="模擬器截圖"></a></p><p> ========已編輯</p><p>我找到了答案,只需將 floatingLabel 替換為常規。 但是,占位符仍未對齊。</p><pre class="lang-js prettyprint-override"> &lt;Item regular&gt; &lt;Label&gt;URL&lt;/Label&gt; &lt;Input onChangeText={url =&gt; setUrl(url)}/&gt; &lt;/Item&gt;</pre><p> <a href="https://i.stack.imgur.com/kWwZs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kWwZs.png" alt="在此處輸入圖像描述"></a></p></div>

[英]<Input /> and <Textarea /> are not aligned in native-base, React Native

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

相關問題 無法更改派生自Android的Native-Base的Picker元素的字體大小和字體粗細 <input>和<textarea></textarea>未在 native-base 中對齊,React Native&lt;/div&gt;<div id="text_translate"><p> 我想使用原生基礎將單行輸入和多行輸入放入表單中,但它們未正確對齊垂直線。 有什么我遺漏的或者不應該一起使用的嗎? 謝謝你。</p><p> package.json 的一部分</p><pre> "expo": "~37.0.3", "native-base": "2.13.8", "react": "~16.9.0", "react-dom": "~16.9.0", "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",</pre><p> 我的代碼</p><pre class="lang-js prettyprint-override"> &lt;Content padder&gt; &lt;Form&gt; &lt;Item regular floatingLabel&gt; &lt;Label style={{paddingTop: 2}}&gt;Label&lt;/Label&gt; &lt;Input onChangeText={url =&gt; setUrl(url)}/&gt; &lt;/Item&gt; &lt;Textarea rowSpan={5} onChangeText={content =&gt; setContent(content)} bordered placeholder="this is textarea" /&gt; &lt;/Form&gt; &lt;/Content&gt;</pre><p> <a href="https://i.stack.imgur.com/gSyge.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gSyge.png" alt="模擬器截圖"></a></p><p> ========已編輯</p><p>我找到了答案,只需將 floatingLabel 替換為常規。 但是,占位符仍未對齊。</p><pre class="lang-js prettyprint-override"> &lt;Item regular&gt; &lt;Label&gt;URL&lt;/Label&gt; &lt;Input onChangeText={url =&gt; setUrl(url)}/&gt; &lt;/Item&gt;</pre><p> <a href="https://i.stack.imgur.com/kWwZs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kWwZs.png" alt="在此處輸入圖像描述"></a></p></div> zIndex doot可在本機卡上運行-反應本機 React-Native native-base 如何減少卡片項目之間的間距? 如何使用native-base在react-native中使圖像上的半透明按鈕? Native-Base 3:菜單項的 Onpress 反應本地和本地基本選擇器組件 如何在Flatlist react-native內部使用ListItem native-base修復“ undefined is not object”(在這種情況下為“ movieItem.poster_path”)? 如何在“選擇”組件本機基礎中有一個搜索欄 反應原生:有沒有辦法只在原生庫的手風琴的 3 選項卡中定位圖標?
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM