Gluon View layout displaced after taking a picture - gluon

When my app is resumed after taking a picture, the layout of the view is displaced:
This effect only occurs when an input node, e.g. TextField was focused and the layout had to be adjusted in order to not make the keyboard cover the input node. Even more interessting, I couldn't reproduce the issue while selecting a picture.
The error occurred when I updated Android 6.0 to 7.0
Edit:
Every now and then, there is a similar error, when the keyboard is hidden (see link):

Related

Charm 4.0.1 possibility to disable layout adjustment when keyboard shows up

I'm facing several problems with the new function which is responsible for adjusting the view layout, when the keyboard shows up.
For example when a DatePicker is shown while a TextField is focused:
Is there a possibility to disable this function?
EDIT:
While removing the focus from the TextField before the DatePicker is shown works, there are still some others issues so I would prefer to use my own custom solution AndroidNodePositionAdjuster.
Another issue e.g. is an unpleasant white area (which will be covered by the keyboard), when the view is transitioned upwards to make room for the soft keyboard, so the transition appears very unsmooth:

Aritchie text truncated for Toast messages on Android

I have installed Aritchie userdialogs version 5 and I'm using Xamarin.Forms Version 2.2. When I use UserDialogs.Instance.ErrorToast on Android, if the text is longer than screen width, it cut.
This is a problem cause the user might not see important part of a message.
(Same toast message on iOS for example not truncated and it takes the size of the content automatically).
How can I increase the height of this rectangle, or set an autosize if exist ?
When your Android app is running with a AppCompatActivity based Activity (which it seems that your is since it is using Material Design), Acr UserDialogs is creating a SnackBar for displaying the Toast, and by design a Google/Android SnackBar is supposed to be a short message.
https://www.google.com/design/spec/components/snackbars-toasts.html
Snackbars provide lightweight feedback about an operation by showing a brief message at the bottom of the screen
As such there is not built-in method for auto-sizing or multi-line wrapping of text. There are other SO questions related to this and their answers all point to the thing, you would need to modify the Android-based view that is contained within the Snackbar fragment when it is created:
TextView tv = (TextView) view.FindViewById(Resource.Id.SnackbarText);
// change the font size, view size, content wrap settings, etc...
If these are important messages that the user needs to dismiss, perhaps using a popup dialog would work in your design.

Labels in XCode View, positioned differently in Simulator?

In XCode 7, on a Swift 2 project, when I place a label onto the View, why is the label centred in XCode, but in the Simulator it's show off to the right?
This is just playing at the moment, where I don't want to play with constraints just yet (which I believe will be used later).
I had the same problem when working through a demo, and this worked for me. Try using the 4.7 inch size view controller:
Look in the middle left hand menu (the Document Outline), if not shown it’s under Editor > Hide Document Outline (a misnomer, clicking it will Show or Hide it).
Click on the View Controller so it's highlighted.
Click on the 4th tab of the right hand one (Utilities: the Attributes Inspector). If not shown it’s under View > Utilities > Show Attributes Inspector.
Under Simulated Metrics is a Size option to change from “Inferred” to “iPhone 4.7-inch”.
You'll need to realign things again, but now these should look central in the View and in the Simulator.
Constraints, when you want to get to them, will probably be more helpful in this regard.

Detail View on Storyboard too zoomed in - creates misaligned objects in simulator

I have perhaps a beginner's question but have not found any solutions addressing this specific problem after searching endlessly on stackoverflow and other forums.
My detail view in the storyboard appears to be too zoomed in. At this point, zooming in and out simply zooms in and out on the storyboard, but not the detail view specifically.
Indicators of this are that the alignment arrow to the left of my button is not positioned at half-latitude of the Detail View box, although when I align my button to this marker I do see a crosshair indicating that my button is "centered".
Detail View - Further Out
Upon simulation, it is apparent that using these crosshairs produces a run-time alignment far right and up from being centered. Where my button is currently placed seems to be in the center of the simulator screen but would like my guidelines to allow the button to be centered using the guidelines suggested.
Simulator View
A) How do I "zoom out" within the Detail View so I can see the entire screen in the detail view?
B) How can I center my object if the guidelines are inherently off-center?
Thank you so much for you advice and input.
Are you using constraints to keep the various controls in place etc...?
If not try:
Select all elements in the UI of the detail view. Click on an empty spot somewhere in the View and press CMD + A.
Click on resolve auto layout issues at the bottom right of the Nib editor. (it's the right most icon)
Click on Clear Constraints
Click on resolve auto layout issues again, then Reset to Suggested Constraints
From here, tweak your constraints as per the UI you're working with i.e. iPhone, iPad and whatever orientation it's in etc...
I forgot to mention how I fixed the "too zoomed-in" problem.
In the storyboard controller, on the left navigator panel, within the file inspector, I simply unchecked "Use Size Classes" within the Interface Builder Document section. My view controller changed into a normal iPhone shape and everything finally fit into place.

Xcode 6.1.1 StoryBoard Size

Good morning,
I am new to Xcode and am learning to create iOS applications.
When I open a single view application and click on main.storyboard, my size is w Any h Any. When I decide to add a label and run the iOS simulator (iPhone 6 or iPhone 5S), the label appears somewhere else.
This is really frustrating and I have tried many approaches such as disabling use size classes, changing the storyboard size by clicking the w Any h Any button, and even messing with the constraints as mentioned here: Xcode 6 Storyboard the wrong size?
I am really trying to continue with this but I have seem to hit a wall for a couple of hours now, if someone could shed some light to why I am messing this up, that would be amazing.
EDIT: How can I get it to be a "normal" sized iPhone, such as the iPhone 5s?
You can click on the w Any h Any to change it to a normal iphone size by mousing over the squares and reading which devices they encompass.
You are going to have to use constraints though in order to make anything go where you want it to, I really didn't want to learn them but I couldn't do without them now: they are very useful.
EDIT
Constraints are simple in concept but can be tricky in certain situations:
For any view to have valid constraints that work correctly, it needs to know what the size of the view is and its position in it's "parent container" which is just whatever view or viewController it is inside of.
The little |-O-| shaped button and its neighboring buttons next to "w Any h Any" give you options for positioning and sizing the view. So if you click on a view and then click on that square button in the middle, check the width, height boxes and click the left and top lines in that top positioning thing with sizes in it like so:
Then click on add 4 constraints. You will notice blue lines appear around your view saying that it can properly put it where it needs to go when running the app. If there is any orange or red that means there are conflicting constraints on the view.
Sometimes that can mean you put to many constraints (more than you need) and you just need to delete them in size inspector tab. But more often than not, if that doesn't fix it, I've noticed that I usually have a neighboring view that isn't properly "constrained" and is actually the cause for the other views problems.
How can I get it to be a "normal" sized iPhone, such as the iPhone 5s
You don't. The view controller's main view will be resized correctly when the app runs (on a device or in the simulator), as appropriate for the device type and other aspects of its surroundings.
Your job is to use auto layout so that no matter how the view is resized, its subviews (labels and buttons and so forth) will look good. That is what auto layout is for - it's to help you compensate for the fact that you have no idea what the real size of this view will be at runtime.

Resources