Tabs are scrolling in blackberry - blackberry

In application i have six tabs. My problem is when i scrolls screen my tab also scrolls but i want tabview to be fixed. Tabs should always be visible.
Starting Screen is:----
After scrolling is:-------
Below share verse button i have displayed ads to view these tabs i need to scroll down. When i scroll down screen look like above image.
Any suggestion would be appericiated. Please let me know where i am doing wrong.
Thanks.

This is what you have now:
MainScreen's default manager (with scroll)
---------------------
| ----------------- |
| | TABS | |
| ----------------- |
| |
| ----------------- |
| | Other things | |
| ----------------- |
---------------------
This is what it should look like:
MainScreen's default manager (without scroll)
------------------------
| -------------------- |
| | TABS | |
| -------------------- |
| |
|VerticalFieldManager |
| -------------------- |
| | Other things | |
| -------------------- |
------------------------
When you are adding things to a MainScreen, you are actually adding it to a VerticalFieldManager that is created behind the scenes in the screen constructor. This manager has scroll by default, but this can be customized in the super call:
public class MyScreen extends MainScreen {
public MyScreen(){
super(Manager.NO_VERTICAL_SCROLL);
}
...
}
Now what you need to add to the screen is your tabs manager, and finally add every other field to a VerticalFieldManager with scroll.

Related

Present a view above the navigation bar but below some other screen content

Currently I have a navigation stack, which is displaying a view. It has a subview floater that takes up a portion of the screen, like so:
+--------+
| navbar |
+--------+
| |
| |
| |
| |
| |
+--------+
|floater |
+--------+
Now, I want to present a view infoSheet modally that animates from the bottom of the screen; eventually, its final state should be behind the floater but in front of the navigation bar, like so:
+--------+
| |
| |
| info |
| Sheet |
| |
| |
| |
+--------+
|floater |
+--------+
I understand if we just want to present something in front of everything else in the window, we have some ways to do it, such as adding the infoSheet as a subview of the navigationController.view. However, since we also need the floater to be in front at all times, including when the infoSheet is animating into view, I believe that approach wouldn't work.

CollectionViewCell out of CollectionView

I implemented an animation that increases the scale of the chosen cell in the collection view, the problem is that when I increase it, the bounds of the collection view cover the cell.
The scenario I'm facing is this:
BEFORE: AFTER:
____________ ____________
| ___ | |_____ |
| (___) | | \ |
|____________| |_____/______|
But this is what I want in fact:
BEFORE: AFTER:
____________ ____________
| ___ | _|_____ |
| (___) | / \ |
|____________| \_______/______|
where the big rectangle is the collection view and the small figure, the collection view cell.
in a nutshell, I want it to be possible for the cell to appear outside the collection view.
How can I do that?

How to keep the navigation controller after clicking on a container view to show?

I have a problem keeping the navigation controller in place I have a ViewController that has a container view holding a TableViewController. Now when I click on a row in the TableViewController to navigate to another ViewController it does not contain the navigation controller for me to go back.
Below is a picture example:
+---------------------------------+
| |
| UINavigationBar |
| | +------------------------+
+---------------------------------+ | |
| +------------------------+ | | |
| | | | | |
| | | |--------| |
| | | | embeded| UITableViewController |
| | | | segue| |
| |UITableViewController | | | |
| | in a container view | | | |
| | | | +------------------------+
| +------------------------+ | |
| | |
| | |
| UIViewController | | show Detail segue
| | | present modal segue
| | |
+---------------------------------+ |
|
+---------------------------------+
| |
| |
| |
| |
| |
| UIViewController |
| |
| |
| |
| |
| |
| |
+---------------------------------+
The last ViewController does not have the Navigation controller passed to it and additionally just to mention that the show segue doesn't work because it clips the ViewController to the same size as the container view so I had to use show detail or present modally to keep the right size.
So overall I am just trying to get the navigation controller to appear on the final ViewController so I can go back.
Thanks in advance for any help at all.
EDITED: BELOW IS AN IMAGE OF WHAT HAPPENS IF I USE SHOW
If you present modally then the navigationcontroller will be gone. If you want to have the exact same navigationcontroller with an automatic back-button you simply need to use a push-segue and not a modal one.
Modal segues come up from the bottom and they need their own navigationcontroller, and also then you'd need to add your own backbutton as the top left navigation barbuttonitem.

Custom SplitViewController with two UINavigationViewControllers Status Bar issue

I have a custom SplitViewController which contains two UINavigationViewControllers. They are aligned like this:
Portrait Landscape
__________ _____________
| | | C | |
| NavCo1 | | o | NavCo2 |
|________| | 1 | |
| | |___|_________|
| NavCo2 |
|________|
The problem on iOS 7 UINavigationBar for NavCo2 doesn't cover the status bar which you see in the second screenshot:
I looked at the frame of both UINavigationBar and the seem the same. I use topLayoutGuide to align them and couldn't find any difference in the two navigation controllers or the view controllers they contain.
Edit:
Looking more into it, it seems that UINavigationBar.barPosition is set to UIBarPositionTopAttached. The problem is this is set over the UIBarPositioningDelegate which can't be changed on UINavigationViewControllers: "Cannot manually set the delegate on a UINavigationBar managed by a controller."

Scrollbars and align to client in a nested form

My app has a form - which is used to design other forms and contains an Object Inspector (bas ascii art follows)
-----------------------
|obj | design forms |
|insp| here |
| | |
-----------------------
so, the app''s main form contains the object form and another form onto which components can be placed (there's also a toolbar at the top to select components, but I haven't shown that).
Now, If I make the main form larger, I would like the contents to expand to fit it ...
-------------------------------
|obj | design forms |
|insp| here |
| | |
| | |
| | |
-------------------------------
so my "form designer" form has Align := alClient;
but, if I place a component on it, so that it overlaps the edge ...
-------------------------------
|obj | design forms |
|insp| here -----------
| | |component|
| | -----------
| | |
-------------------------------
the screen of course shows
-------------------------------
|obj | design forms |
|insp| here -----|
| | |comp|
| | -----|
| | |
-------------------------------
and I would like an auto scroll bar.
But, it seems that Align := alClient; overrides AutoScroll := true;
Any idea how to resolve this conflict?
1) the designer area should shrink and grow, always filling the right part of the main form as the main form is resized
2) if a component is placed which would overhang the edge of the designer form then it should grow scroll bar(s)
OR am I totally missing the point? I have code that handles the placing of the component - should I be checking there if I need to add scrollbars?
I think a relatively easy solution would be to switch the form's Align to alNone and position and size it on the parent form's resize event. Presumably you've got a splitter in there whose size events you would also have to listen to.
So long as you only have the inspector and the design form then that's a pretty simple solution to implement. If you have more tool windows in there then it would get more tricky but the basic idea can be extended.

Resources