How to use a button to change style of a TextInput - react-native

Need to make a button change the color of the font from a TextInput textbox to atleast 4 different colors.
so, i'm quite new in react-native and im having a problem to solve one of my assignments, my teacher asked us to create a button that changes the color of the font inside a Text Input text box to one of 4 different colors presets onPress , couldn't figure it out on my own and cant seem to find any tutorial with this kinda of examples, just found some tutorials that only explain how to change the color from the buttons onPress.

Since you mentioned this is your assignment from your teacher, I would not provide any code, but just a general guideline on how to create the code yourself so that you could try and make it yourself.
What you need to do are :
Create the 4 styles for the text color as const that you can refer to later.
You would also want to have a state to indicate which color you want to show and change it according to the button pressed.
And you would need to pick the correct style from the const made from step 1 above based on the state like shown on this link.
Hope you good luck ini finishing your assignment.

Related

How to create "menu grid" in kotlin

I have searched google/stackoverflow etc. for answer to my question, but I didn't quite manage to find the right one. I believe I just don't know, how to set the question properly, and thus I cannot find solution.
Is there any way, how to create grid like I drawed in following image (with red colour):
I need to add this red grid to several images, which look very simmilar. The grid field (the one selected) have rolling menu, prescribed position, and a field for additional text. Black lines in background are image in background, and the red supposed to be grid above the image. I thought of creating a lot of buttons alined to each other, but i think that is very bad way to do so.
I would like a pop-up menu from selected field, but opening new activity with same fields is usable aswell. Is there any "simple" solution for creating such grid/menu ?
Btw, I am not programmer with many experience with coding, let's say, I know basics only.
Thanks in advance.

How do I put Fontawesome icons in input "value" fields?

I am not using a button for this particular part of the code, only an input field (and any button I added isn't working) but I would like a calculator icon next to the word "Calculate" in the "value" field.
So far I have this:
value=" Calculate"
But this is failing to reproduce the calculator icon (the code does turn blue as though it has been accepted but the icon fails to load).
f1ec is the unicode of the icon at Fontawesome. I can not seem to get a value that works and displays. Is there another way around this or have I done the unicode incorrectly?
Thanks for the help.

how to change colour of the text entered in label as we enter the desired regular expression in password text field?

I am new to objective C and I dont know if this can be done without any library or not but if yes kindly let me know...
I have a view in which I have added a button & textfield with some character like "A b # 1 6". Here I need to change the color of characters as I enter the password.
I mean to say when I enter T color or 'A' changes, p is pressed 'b' color changes and so on if I enter special character that color changes and minimum lenth is 6 so when I enter 6 character color of 6 changes.
I tried it with using regular expression but i need this functionality.
for refrence I am adding Image.
I have updated my code instead of labels I have taken Buttons to show the changes. Here is my code:
Now I want to know when user delete character from textfield the color should get back to normal color. I mean if user deletes "A" then button roundButtonCapital should change to normal button.
I hope I am clear. Please let me know if any doubt.
https://drive.google.com/file/d/0B3EymICOjqeNM01zcEQ4eUN0eUk/view?usp=sharing
Now I want to know when user delete character from textfield the color should get back to normal color.
At a guess when checking the user input you are only setting the color if the particular condition - uppercase, length, etc. - is met. You should always set the color, to the "passed" color if the condition is met and to the normal color if it is not. Do this on every change to the user input, addition or deletion, and your indicators will always be correct.
Note: You did not edit your question to include minimal code fragments, posting a link to a file is no substitute for this. You need to isolate the problem, which is what you should be doing anyway in trying to solve it, show the code for that issue in the question.
In this case you maybe could have include the code for a particular test - uppercase, digit, etc. - and explain what it was doing right and what didn't work. Maybe here because I don't know my answer is correct, it is a guess - to be sure I'd have to scroll through in detail 5 pages of code on a tablet I'm currently typing this on, essentially debug your code and that is not what Stack Overflow is here for.
You have help people help you, and show you've put effort in, or people just won't be willing to put in effort to help you.
That said, I hope the guess helps, and stick with SO asking and answering questions!

wacom and myscript set handwritng recognition function

im not sure if its the right place to put my question, but i think maybe get an answer here.
the last few days thinking about a way to make μυ work easier.
What I want is to write by hand and convert into text on the computer.
namely when I am on a page with multiple text forms like this im writing now,
when i choose a text form with a pen (like wacom graphic tablet) write on a surface and the automaticaly when i stop or pressing a button the text turn into text in the form.
my title say about wacom because i found bamboo scribe.. if someone uses this please explain me whats can do and if can work for me.
i test myscript. with fullscreen tool wich you can write everywhere on the screen is easiest but when you finish you have to press a button on the program to insert the text in the selected area.
so my question is there any way to press that button with the button placed on stylus pen?
i saw that you can set functions when a button clicked on the wacom tablet or on pen.
i have not bought yet anything because im searching if is out there anything could do what i want better. something made for that particular job
Thanks and sorry for my bad english..

Formatted Text and Popovers in iOS4

I'm working on a prototype app that has a challenging behavior. I thought I'd ask for advice before really tearing into it...
Part of the app has an area of text that needs to be formatted in a manner where there will be a description of an item in bold, followed by one or more detail items:
Item Description: Item Detail 1. Item Detail 2. Item Detail N.
In most cases these items will require multiple lines, so word wrapping will be necessary.
The the user will be able to tap on any bolded item description to expose a popover with options they can select that will populate the plain item details.
I was about to attempt doing this with a webview, to be able to format the text, provide natural word wrapping and use hyperlinks to call methods, etc... As I look into this more, I can see it will be a pretty weighty task and want to make sure there aren't alternatives to this before I head down what looks like a fairly long, dark tunnel.
I'm still fairly new to iOS dev, so bear with me if I come back with "noob" questions.
Thanks in advance!
The alternative is Core Text but it is a fairly long, dark tunnel, too.