Objective C - wantsFullScreenLayout not covering TabBarController - tabbarcontroller

I've been trying to get a section of my TabBarController to go fullscreen for a while but still can't figure out this 1 last piece.
So I'm able to put the UIViewController behind UINavigationBar using the code below.
self.navigationController.navigationBar.translucent = YES;
self.wantsFullScreenLayout = YES;
Also able to hide the UINavigationBar & TabBarController using the code below.
[self.navigationController setNavigationBarHidden:YES animated:NO];
[self.tabBarController.tabBar setHidden:YES];
However, my UIViewController's height still wouldn't extend behind where the TabBarController is before I hide it. So it looks as though there is a blank space below.
Image attached.
I tried changing self.tabBarController.view.frame and bound. Still doesn't do it. Seems like something is preventing it to cover that bottom portion.
How can I achieve that?
Thank you,
Tee

UITabBarController is not designed to allow its subview to go "behind" the tab bar, probably because a tab bar cannot be translucent. And although [self.tabBarController.tabBar setHidden:YES] does hide the tab bar, it doesn't tell the UITabBarController to lay out your view in the space that is normally occupied by the tab bar. In fact, there is no really supported way to do this.
OTOH, it is easy enough to reposition the tab bar manually if you are willing to risk things breaking in a future version of iOS. The UITabBarController's view has two subviews: one is the tab bar, and the other is the content view (which contains the view from the currently active view controller). Just resize the content view to occupy the space; you could even animate the tab bar moving off the bottom of the screen if you'd like.

Related

How to Move content to next page in WPF Form

I am new in WPF if there is something wrong please co-operate.Here i require some idea from experts.
I am working on one application in which i have to show some content on WPF form after filling the fields present on the form.On the same form i also have a print option.
Check this image.This is my form here part in the red block is generated at runtime.When i click on the print button it only show the visible part on the paper and skip the remaining part.
Problem :
How i can move the remaining part of the form which is under scroll to next page when i click on print.
For example in the given image we can see only 2 bulls eye completely and next 2 partially.How i can shift this remaining part to next page only when i click on print.
The answer is quite easy : don't rely on your window to do the printing, but build the visual you want then print it.
For instance, you must have a function that creates dynamically the circles and so on, then adds them to a Panel. What you might do is to print the Panel.
Or if you prefer, you might build Dynamically a new window, where you put all the Data you want printed as you want, then print the window. The advantage of this method is that it is more flexible for the content (if you want a header/footer) and also you can watch the content easily for debug. Note that even if the Window content is dynamic, you can have a base window for printing that avoids you to do too much xaml with code (expl : you might have TextBox bound to a PrintTitle property that you setup in the constructor of the Print Window...).
Notice that visual that were not rendered on screen will not print. Be sure, to avoid the common issues, to have a look at this article from this great site, switch on the code, here :
http://www.switchonthecode.com/tutorials/printing-in-wpf
Edit (reply to the question in comment):
1) If you have fixed number of bulls eyes, just make one Window for that number and Print it, this is waaaay easier.
2) To put Visuals in pages instead of rows, you'll have to rely on page Width/Height. What matters is the size of your control vs size of page. In the example, they build (in OnRender) Controls having LineHeight, LineWidth as size. Do the same : Try to put as many line of control as you can such as
(Control Height + margin )*NumberOfControlPerPage < Page Height.
Then you have to change OnRender to render controls instead of Rows made with rectangle+text. Pack your controls two by two in Horizontal StackPanels Then pack those StackPanel into a vertical StackPanel, then render. You have to keep track for each page which control was rendered last, then resume rendering at the following control.
Please follow this link.This is the basic which i got after searching in web world.Using this basic detail you can do any thing with print in WPF

ImageViewer in WPF

Hi everyone I would like to implement an ImageViewer (like the one in Facebook for example) in a WPF application
I already have a ListBox whith my pictures, it works well. But I would like to add pop "image full size" when the user double click on one of them. (something like in FB, with a fade out of the background etc).
Currently I'm thinking of to use a Window...Do you have a better idea of what I should use ?
i would probably use a window for that as well. Then you can easily put an opacity animation when the window loads to give it the fade in and fade out effect
You could also use a Popup control.
It comes with some some built in (but very limited) animations, like fade, see PopupAnimation.
I'd try that and if it doesn't fit your needs, I second bflosabre91 oppionion and would use a separate opacity animated window.
But bear in mind that with an additional window you could have negative side effects e.g always sync the window positions correctly, handle task switches (ie. correctly hide the window in the taskbar/tasklist)

FlowDocumentScrollViewer vs FlowDocumentPageViewer

I have 2 possible ways to display my FlowDocument:
FlowDocumentScrollViewer
Upside:
- This just presents me the data, with no attention to pages, so the user simply scrolls through everything. On printing I can add a header and a footer and the pages are decided there.
- When I resize my window, the content stays correctly at 100% zoom, as I want it to be.
Downside:
- With a lot of data it just crashes, it seems to render all controls at once, or something.
FlowDocumentPageViewer
Upside:
- With a lot of data it's still fast.
Downside:
- It decides pages for me, which are irrelevant.
- When I resize my window, the content zooms out to fit the window. Which makes the content unreadable very quickly. Possible fix to this is surrounding the control with a ScrollViewer, which works. But when you scroll down to view bottom page content, at the end it goes to the next page, and if you then scroll up too far it goes to previous page, very annoying.
What I eventually want is the FlowDocumentScrollViewer, but then with fast loading time.
Anyone with any ideas/tips on this matter? Much appreciated!
Use a FlowDocumentReader then the user can can go scroll or page at run time. This will not solve stability problems. I display some documents with 200,000 characters and it is stable for me. It load via Dispatcher so may want to look there.

How should I display a notification bar in WinForms?

You all know the "You've got new answers!" notification bar on SO. I'd like the same thing in a Form, preferably just as smooth. Is there a simple way? Or do I have to completely create this myself?
My searches did not yield any good results, only lots of progress bars and popups in the system notification area, but that's not what I'm looking for.
The messages I want to display belong to a Form, not to the whole application
You could simply animate a panel dropping down from the top of the client area of the form.
Increasing the y coordinate of the panel in a timed loop. The panel would start invisible and slowly become visible. (The panel would start at -panel.height and work its way down to 0.)
Create two panels in your form, a notification panel docked to top, and below that a content panel anchored to top. In your Form.Load, set the height of the notification panel to zero. Don't set the height to zero in Design View, you won't be able to click on the notification panel to edit it.
Then when you get a notification, draw the contents in the notification panel and create a System.Windows.Form.Timer that increases the height of the notification panel by a few pixels every few dozen milliseconds or so. Stop when the panel is of the desired height. Do the same with a negative height to hide the panel.
This does not require repainting or recalculating sizes or positions of anything, does not overdraw anything, and looks slick. I have done this and it works.
If you want it constrained to a particular form, it should be easy enough to put a Panel on the form with its Dock set to DockStyle.Top, then place a label for the description and a button that hides it.
It's not difficult to do with a panel or a UserControl, but the fiddly part is making the contents of the form slide down as the bar slides down. To simplify that I would use a SplitContainer. The top splitpanel contains the notification bar and the splitter distance is initially 0. Slide the bar into view by incrementing the SplitterDistance property. Doing it this way means you don't have to worry about making the other contents of the form slide down (which is a hassle because it prevents you from using docking).
The only downside to using SplitContainer I can think of is that the animation of the bar will be slightly different: the text won't scroll down with the bar, it will be revealed in place as the bar slides down. If this bothers you, you can fix it by having the text (or your panel/custom control) slide down as you increase the splitter distance (only a couple more lines of code).
Showing the bar:
for (int i = 0; i <= 33; i++)
{
splitContainer1.SplitterDistance = i;
Thread.Sleep(5);
Refresh();
}
Hiding the bar:
for (int i = 33; i >= 0; i--)
{
splitContainer1.SplitterDistance = i;
Thread.Sleep(5);
Refresh();
}
Of course, if you don't mind the notification bar simply covering the top part of your form, then you can just do the whole thing very easily with a panel. :)
I was looking for the same thing just now and found this on code project
I have not used it yet, So I have no idea how solid it is.

Center title bar caption of Syncfusion WinForms ribbon form?

Is there a way to center-align the text in a WinForms form? Also known as the title bar caption or title bar text? So far the only way I can see to do it is pad the string with spaces. I am setting the title bar caption using the Form.Text property.
I should add that I am using a 3rd party ribbon form, so the app looks like a Microsoft Office 2007 application. And those apps center-align the text, presumably because when the text is left-aligned it gets added to the jumble of buttons on the top left and looks bad.
Honestly - don't. Windows users expect certain things to work in a certain way, and this would not meet standard practices. Not to mention that the button in the taskbar would then no longer show the titlebar text as it would be pushed to the right.
You can take over the non-client area of a form completely, in which case you can do what you like. Even if you did this, though, my recommendation for your design would be to have the title at the top left, close button at the top right, etc.
For anyone who is interested, I am using Syncfusion Essential Tools. The solution is this:
this.ribbonToolbar.TitleAlignment = Syncfusion.Windows.Forms.Tools.TextAlignment.Center;
The title alignment is a property of the ribbon toolbar and not of the RibbonForm, which explains why I didn't find it before. Thanks to all who responded.
The title bar is rendered by the system and there is no option for centering the text.
In order to effectively center, you'd need to draw the title bar yourself - this can be done in native code by handling WM_NCPAINT messages and such but not sure how this can easily be done in .NET.
But why do you want to change? Windows UX standards have the text left aligned.
I don't believe you can.
You could hide the title bar, and replace it with a user control and implement the same functionality a title bar has, but I don't think that would be a good idea.
Consistency for the user is probably more important than whatever reason you have for wanting to center the text.

Resources