ScrollingView editable in height Xamarin.ios - layout

I have been trying to create a ScrollingView on Xamarin.ios for several days now which shrinks and enlarges when I establish it, showing a larger scrollable part and hiding the empty part if necessary. I'm trying to handle it like this:
ScrollView.ContentSize = new CGSize(View.Bounds.Width, ViewBackground.Bounds.Height - (StackEsercizio.Bounds.Height * 1));
This statement works partially, only when placed in the ViewDidAppear and only for the first time. Do you have any advice or solution?
Finally, I solved it on my own. For the growth of the community, place the solution on github at this link: https://github.com/aleledda98/MyfitnessApp/blob/master/CreaSchedaNew.cs
the scrolling view moves dynamically based on the number of letters entered on a specific UITextField, thanks to all the same <3

Related

How to fix UICollectionView - All cells disappear - Xamarin ios

I am using a UICollectionView in C# Xamarin ios and sometimes all of the cells will disappear from the screen. This happens normally on a scroll and I have to re-invoke the view that my UICollection View is on.
I can't show my exact code as this is a project that I am working on but the initialization basics look a little like this:
Bounds screenBounds = screen.Bounds
UICollectionViewFlowLayout layout = new UICollectionViewFlowLayout();
UICollectionView collectionView = new UICollectionView(layout, bounds)
I initialize a few other things like source and register cell and also add separation and border styles.
I have been also getting an error about a view not being in the hierarchy don't know if this has anything to do with it.
I do return the collectionView at the end and will add this returned value to my template which has a scroll view in which I add the UICollectionView to.
May I also mention I don't use any of the StoryBoard and am using a DuqueReusable cell in my collection view source.
I have been stuck on this for ages so thank you in advance for anyone who can give me any sort of tips or answers to this question.
Insure you make any changes to ItemsSource or to cells data on UI thread only, otherwise you might obtains an uncatchanble async crash and you'll end up with an empty view.
Device.BeginInvokeOnMainThread(() => {
// do your stuff
});

Interesting visual bug with bootstrap form inputs

I am using bootstrap forms. In a form group I have some check boxes. When I hover my mouse over the first one, it highlights the first one as expected. When I hover over the second one, it highlights the second one and the first one. When I hover over the third one, it highlights the third one and the first one. And so on... I'm wondering if this is a known bug with bootstrap? I'm using nodeJS with pug on express server. Her is my code:
.form-group.centerCheckboxes
label Local Center Statistics
.form-check
label.form-check-label
input#tutorRequestFrequency.form-check-input(type='checkbox' value='tutorRequestFrequency')
| Tutor request frequency
.form-check
label.form-check-label
input#totalWorkingHours.form-check-input(type='checkbox' value='totalWorkingHours')
| Total working hours
.form-check
label.form-check-label
input#totalHoursTutored.form-check-input(type='checkbox' value='totalHoursTutored')
| Total hours tutored
.form-check
label.form-check-label
input#totalWeightPulled.form-check-input(type='checkbox' value='totalWeightPulled')
| Tutors "weight pulled" ratios
perhaps I am using bootstrap classes wrong? This is all within a grid system but I've triple checked the grid to make sure all the numbers rows and columns were used properly. Has anybody ever heard of this problem or know why it is happening?
I found the issue. It's because I was using the label tag incorrectly. when I hovered over anything within the .form-group it was also hovering over the label which was automatically being applied to the first checkbox in the list.
To solve this, instead of using label I instead used div then put the text that was originally inside the label inside the div.

How to display the restricted rows in ListView

I have taken the horizontal list view.I am able to display the images in list view.It is displaying all the images horizontally.But my requirement is i need to show only 4 images in a row.If there is 5th image then it should come in the second row(for each row there should me only 4 images).How can i do this.Actually i am struck up here.I think you are able to understand my problem.Thank You.
I am using JavaFX 2.x
As far as I understand, if you need to allocate only 4 images in a row, and the 5th+ images transfer on the next row, you will be able to use a GridPane :
http://docs.oracle.com/javafx/2/layout/builtin_layouts.htm
where you could obviously set position of ImageView. Seems, it works so : you determine your own ListCell, and set its graphic node to be a gridpane, and configure grid pane as you wish.
Also, take a look on a flow pane, possibly, it will help you.
If I'm wrong with a recipe, please, try to describe your trouble again (code/screenshot). I'm not comletely sure about it.

ExtJS 3.4 EditorGridPanel Layout Issues

GridPanel not rendering correctly
I'm using EditorGridPanels on dynamically generated web pages. ExtJS does not control the ViewPort.
When I wrap the Grid generation code in Ext.onReady(), the grids render perfectly.
If I do not wrap it in Ext.onReady() it renders with subtle layout issues like
the grids are a little too wide
the top toolbar gets cut off on the right
the rows don't quite fit and they shift when clicking a cell
I have tried forcing the grids' layout to get recalculated once the page loads...
(function(){}
var grid = ...
[ ... ]
Ext.onReady(function(){
grid.doLayout();
});
)();
...but this does not work.
The reason I'm trying to avoid placing Grid initialization inside Ext.onReady() is that sometimes pages take a long time to fully load every resource, and in these cases the pages look fully loaded apart from the blank spaces where the grids eventually get rendered to!
Any suggestions on what I might try? Right now a complete redesign of the page is not in scope, so I'm looking for something I can do to get the grid to layout like it does when initialized inside onReady()!
Thanks
You could perhaps mask the page initially with 'loading..' message and remove this in the onReady().
If you're getting issue outside of on the onReady it would indicate something has not loaded when you're trying to render components, this in my experience will lead to further issues down the line.

How can I have two items next to eachother, in a row, on a form?

Form containerForm=new Form(filename);
StringItem label1 = new StringItem("","Test\nTest2\nTest3");
StringItem label2 = new StringItem("","Test\nTest2\nTest3");
label2.setLayout(Item.LAYOUT_LEFT|Item.LAYOUT_TOP|Item.LAYOUT_SHRINK );
label2.setLayout(Item.LAYOUT_RIGHT|Item.LAYOUT_TOP|Item.LAYOUT_SHRINK );
containerForm.append(label1);
containerForm.append(label2);
display.setCurrent(containerForm);
This code produces this:
I want it so the two StringItems are next to eachother, and test is lined up with test, and so on.
I've also tried combining the two stringitems into one and adding a tab (\t) between them. The tab turned into nothing, however.
if you're on MIDP 2 it would be safer to also set LAYOUT_2 in addition to directives you already have set. Per my recollection of API spec, without this flag device may (or maybe even should) fall to MIDP 1 layout style ignoring your precious TOP and SHRINK.
Consider also using Item.setPreferredWidth(containerForm.getWidth()/3) to explicitly indicate that you want it to be not too wide. There seem to be small (but non-zero) chance that stupid device believes that preferred width of your string items is that of the screen which in turn somehow overrules shrink directive.
Java ME uses a row layout, which means every item you add is added in the next row of the GUI. You need something like a GridLayout which is not available in Java ME. Maybe you have to write your own Item which contains both labels. Similar to here. Here is a stackoverflow question on Gridlayouts in Java ME: Table or gridlayout in J2ME
Use the GridLayout using LWUIT
http://lwuit.java.net/tutorial/layouts.html

Resources