how to use TM symbol in titanium UI component - titanium

I want to use TM (trademark symbol) while creating label.
Ti.UI.createLabel({
text: '© ' + (new Date().getFullYear()) + ' companyname 0xE2 0x84 0xA2',
font: {
fontSize: 13,
fontWeight: 'bold',
fontFamily: 'Verdana'
},
color: '#FFFFFF',
left: 3,
bottom: 5,
visible: false
});
Previously used copyright symbol as copy-paste. but this will be last option.
Any help ?

you can use it like this:
var l = Ti.UI.createLabel({
text: '© ' + (new Date().getFullYear()) + ' companyname \u2122',
font: {
fontSize: 20,
fontWeight: 'bold'
},
color: '#000'
});
it will display © 2020 companyname ™

Related

React native - Dropdown text alignment issue

<Dropdowndata={linkedToList != null ?
linkedToList.map((item, key) => ({
label: item.claim_slug_id, value: item.claim_id
})) : submittingOption}
textInputStyle={{ marginTop: 0, height: 42, fontSize: 14, fontFamily: 'Poppins-Regular', color: color.black }}
itemTextStyle={{ fontFamily: 'Poppins-Regular', color: color.black }}
selectedItemTextStyle={{ fontFamily: 'Poppins-Regular', color: color.dark_color }}
disableSelectionTick
disableSort
removeLabel
enableSearch
underlineColor={color.bg_color}
value={selectedTypeOfClaim}
onChange={(value, index) => {
}
/>
The issue is that, in the Dropdown menu the text is not align in case of 2 line.
While it's working fine in case of single line.

Problem with vertical align hebrew text (rtl mode) in react native app

when we use firstName and lastName without a space - everything is fine
image
but if you add a space to one of the words, the other word rises up
image
code
JSX:
<View style={styles.nameContainer}>
<Text style={styles.firstname} numberOfLines={1}>{firstName}</Text>
<Text style={styles.lastname} numberOfLines={1}>{lastName}</Text>
</View>
Styles:
nameContainer: {
flexDirection: 'row',
maxWidth: 176,
overflow: 'hidden'
},
firstname: {
fontSize: 16,
color: Colors.light.text,
fontWeight: 'bold',
marginEnd: 4
},
lastname: {
fontSize: 16,
color: Colors.light.text,
fontWeight: 'bold',
paddingRight: isRTL ? 0 : 24,
marginRight: isRTL ? 0 : 8,
marginBottom: 4,
},
can someone tell me why this is happening?
Hi check this issue https://github.com/facebook/react-native/issues/10712 might help.

How to change the color of the dropdown icon on the right of SectionedMultiSelect - react-native-sectioned-multi-select

I want to change the color of the dropdown icon on the right of SectionedMultiSelect from the default color. Here is my code:
<SectionedMultiSelect
items={items}
IconRenderer={Icon}
uniqueKey="id"
// subKey="children"
selectText="Click to select Expertise"
showDropDowns={true}
onSelectedItemsChange={(selectedItems) => {
setDidUpdate(true);
setExpertise(selectedItems)
}}
selectedItems={expertise}
colors= {{
primary: 'red'
}}
styles={{
// chipText: {
// maxWidth: Dimensions.get('screen').width - 90,
// },
chipContainer : {
// backgroundColor: 'red',
// color: 'green',
borderRadius: 16,
borderWidth: 2,
borderColor: 'white',
marginTop: 10
},
chipText: {
color: 'white',
},
chipIcon: {
color: 'white',
},
button: {
backgroundColor: '#FF9017',
},
selectToggle: {
color: 'white',
},
selectToggleText: {
color: 'white',
// backgroundColor: 'red',
borderWidth: 2,
borderRadius:25,
borderColor: '#fff',
padding: 5,
paddingLeft: 15
},
}}
/>
I have tried changing it through the styles and the color props but to no avail.

react native input elements: change the height of input container

I have an input container using react-native-elements, and the container includes an icon. I would like to reduce the height of the container but getting a bad result, the height around the icon doesn't fit:
My styling:
input: {
layout: {
...inputs.darkCredentials,
containerStyle: {
...inputs.darkCredentials.containerStyle,
width: '100%',
padding: 0,
marginTop: Platform.OS === 'ios' ? 25 : 17,
marginBottom: Platform.OS === 'ios' ? 15 : 13,
borderRadius: 12,
height: 32,
// marginBottom: 45,
elevation: 5,
shadowColor: '#000000',
shadowOffset: { height: 0.5 },
shadowOpacity: 0.15,
shadowRadius: 5,
},
leftIconContainerStyle: {
...inputs.darkCredentials.leftIconContainerStyle,
// height: Platform.OS === 'ios' ? 40 : 45,
backgroundColor: greenPrestoDark,
padding: 0,
height: 32,
margin: 0,
paddingLeft: 15,
borderRadius: 12,
},
labelStyle: {
marginLeft: 10,
height: 32,
color: 'white',
position: 'absolute',
top: -25,
},
},
and for the icon:
icon: {
layout: {
type: 'material-community',
name: 'lock',
...icons.darkCredentials,
size: 32,
height: 32,
style: { color: 'white' },
},
I'm trying to set height: 32 everywhere
What should I do to reduce the height of the input container altogether?
Can you charge this way
inputStyle={styles.inputStyle}
inputStyle: {
height:200
},
This is My way
<Input
inputStyle={{
fontSize: 12,
}}
// labelStyle={{height: 8}}
inputContainerStyle={{
borderWidth: 1,
height: 30,
marginLeft: pxToDp(-8),
borderColor: '#2F4972',
backgroundColor: '#E2E2E2',
}}
placeholder="设备名称/位置信息"
placeholderTextColor="#000"
/>
the inputContainerStyle is key

What Is The Best Way To Have Typography Namespacing In React Native Apps

I'm working on large scale application where there are lots of font sizes are used. I want to set all type of typography style in the app which can easily reuse. Please suggest me how can i do that. Here is my code.
Is h6, bodyFont has meaningful namespacing if not please help me to define the typgraphy.
// global styles
'use strict';
import { StyleSheet } from "react-native";
import { colors, fontSize, font, fontWeight } from "./base";
const styles = StyleSheet.create({
// font color helepers styles
textPrimary: {
color: colors.primary
},
textMuted: {
color: colors.lightenGrey
},
// font helepers styles
bodyFont: {
color: colors.grey,
fontFamily: font
},
fontWeightBold: {
fontWeight: fontWeight.bold
},
fontWeightLight: {
fontWeight: fontWeight.light
},
fontSm: {
fontSize: fontSize.sm
},
fontXs: {
fontSize: fontSize.xs
},
fontMd: {
fontSize: fontSize.md
},
fontLg: {
fontSize: fontSize.lg
},
fontXl: {
fontSize: fontSize.xl
},
fontXxl: {
fontSize: fontSize.xxl
},
// text alignment helepers
textCenter: {
textAlign: "center"
},
// margin heleper styles
mb10: {
marginBottom: 10
},
mt30: {
marginTop: 30
},
mb30: {
marginBottom: 30
},
mr20: {
marginRight: 20
},
// typography
body: {
color: colors.grey,
fontFamily: font,
fontSize: fontSize.sm,
fontWeight: fontWeight.light,
marginBottom: 10
},
h6: {
color: colors.grey,
fontFamily: font,
fontSize: fontSize.sm,
fontWeight: fontWeight.bold,
marginBottom: 10
},
avatar: {
width: 60,
height: 60,
borderRadius: 30
}
});
export default styles;
I think that you have the right code. Now to use it just import that component where you want to use it.
For example:
import StylesText from 'yourpathhere';
.....
<Text style {StylesText.textPrimary}>{'Hello world'}</Text>