React Native TIPs

1. TextInput <TextInput style={styles.textfield} maxLength={2} placeholder=”Phone Number” autoCapitalize=”none” // sentences: first letter of each sentence (default). keyboardType = ‘numeric’ // ‘default’ ’email-address’ autoCorrect={false} blurOnSubmit={true} placeholderTextColor={MKColor.Grey} onChangeText={(text) => this.setState({mobile: text})} underlineColorAndroid=”rgba(0,0,0,0)” editable={false} selectTextOnFocus={false} onFocus={() => console.log(“focus received”)} onBlur={() => console.log(“focus lost”)} Read more…

iOS error

Error: Don’t forget to anonymize any private data! `parse_results’: undefined method `map’ for nil:NilClass (NoMethodError) Solution: gem update xcodeproj  

Android Kotlin SpannableString Example

Result activity_main.xml <?xml version=”1.0″ encoding=”utf-8″?> <android.support.constraint.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent” android:background=”@android:color/white” tools:context=”.MainActivity”> <TextView android:id=”@+id/textView” android:textSize=”20sp” android:textAlignment=”center” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Hello World!” android:background=”@android:color/white” android:textColorHighlight=”@android:color/white” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintRight_toRightOf=”parent” app:layout_constraintTop_toTopOf=”parent”/> </android.support.constraint.ConstraintLayout> MainActivity.kt class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Read more…

Shot but useful

Close/hide the Android Soft Keyboard everywhere you want, Change Image of ImageView programmatically in Android, Height of status bar in Android Close/hide the Android Soft Keyboard everywhere you want getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); Change Image of ImageView programmatically in Android imageView.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.your_image)); Height of status Read more…