Replicate a draggable image on the click of a button - objective-c

I am trying to create a draggable image upon button click in Objective C. For example, lets say the image is an X or an O or simply a dot. Each time I click an "Add" button, I would like for an image to appear.
After that I am looking for each image to be numbered. For example, the first addition of an image will be a circle with a 1 in it, and the second addition of an image will be a circle with a 2 in it and so on.

Related

How can different animations can be attached to an image dynamically in react-native?

Asume there is an image on the screen and when a user presses another image (say right arrow) the first image goes right and when the user presses a third image (say left arrow) the first image goes left.
Briefly something like this, the left arrow should move the stickman to the left and the right should move to the right:
According to the documentation, an image can have multiple animations (transforms, scales, opacity changes etc) but it seems all those animations need to be run parallel (simultaneously).
My question is about doing this with a function call freely from unrelated objects.
You can just have an animation value for how much you want to move the stick man. Just give the stick man a
style={{transform:[{translateX: this.stickManTranslateX}]}} then you can just have the arrows use the moveStickManLeft function for it to move in different directions.
stickManTranslateX = new Animated.value(0);
moveStickManLeft = toValue => {
this.stickManTranslateX.setValue(toValue);
}

Displaying overlayed QGraphicsItems

I have developed an application in PyQt5 that displays an image and allows the user to pan the image using the mouse and zoom using the mouse wheel. I now need to add the functionality to show popup text associated to specific parts of the displayed image. While painting the text directly on to the QGraphicsScene is a possibility, the range of zooms that are commonly used means that the text will be much too small when zoomed out, or much too large when zoomed in.
I would like to achieve a way of placing the QGraphicsTextItem widgets at a static location that is not affected by the pan and zoom. This way, they can be statically located around the perimiter of the QGrapicsView, and I can draw a line from the text box to the position in the scene. My problem is that I cannot find a way to place the text items so they are independant of the QGraphicsScene. I am thinking that I should have the text items external to the scene, and place the QGraphicsView and any text boxes in a parent QObject. I cannot figure out if this is the best method, and have had limited success with trying to connect a line from QGraphicsElipsesItem that marks the position on the image, to a QLabel in the parent QObject.
I hope I have made this clear enough. Please comment if it needs more clarification.

UIButtons Alignment

I am trying to implement like word cloud in my app.
The image shown is like word cloud with left alignment.
What I did was, for placing the buttons I am checking whether the width of the text is greater than total width of the screen, if it is greater place the button in next row i.e increment the y position, if it is not just place the buttons. Everything is working fine. But what I want now is , i want to move the buttons alignment, like, I want to start the first button from center of the screen. Please help me to do this...

new to Xcode 7 ; simple label will not center in the simulator

I am taking a class online and one of the projects is to create a label.
In Xcode, I have centered it on both the vertical and horizontal axis, but when I run the simulator, and its always to the right side, not centered. I even tried it with other simulated phones.
This happens with text fields too.
I'm really not sure what is wrong, because in Xcode it is displaying correctly.
Follow these steps.
First Drag and drop a UILabel.
2.Check below picture
Now click on the green circle icon (right - bottom corner, second from left) shown in below image
Then you can see a popup appears like below image, click on "Horizontally in Container" option.
5.Click on this red circle icon(right-bottom corner)(next to the previous green circle icon), Then you can see another popup like below image.
Now you can see a popup like this
In this Uncheck " Contrain to margins" options so it will look like this below image
Save and Run your code, so you can see the UILabel at center for all devices.
Output will be like

how can I transform size of svg with svg-edit

Is it possible to change the size of an existing svg using svg edit? I https://code.google.com/p/svg-edit/ I have a rather large svg that I wish to scale down. Google's tool doesn't have an icon (that I can see) to scale the size
Scaling an entire SVG document isn't really supported as a button press or anything but it can be accomplished.
Open your project into SVG-Edit, select everything (press A on your keyboard) then right click and choose Group. Then go to Menu > Document Properties and enter your new dimensions. Then select your SVG content and move it onto your new small canvas. Easiest way is to use the X and Y coordinates in the top grey bar (enter 0 for both). Then just resize the whole document as needed by dragging the small circles located on the corners of your content. Hold the shift key on your keyboard to scale proportionately.