PagerSlidingTabStrip: ViewPager tabs resize - android-fragments

How to show the tabs in the ViewPager to the one screen? I am using android.support.v4.view.ViewPager.
When i used this
these tabs are shown in one scrren.
String[] tabs = {"A","B","C","D"};
when i used this
<b> String[] tabs = {"My School", "My Home","Search & Find", "Books & Books"};</b>
these tabs are shown with swaping,not in one screen.
How can i put these tabs in one screen.
plz help me

Include this to your PagerSlidingTabStrip
app:pstsShouldExpand="true"
This maybe work.
Sorry for my english, I am from Venezuela! :-)

Related

ButtonBar: Same Button Height

I have an app with a very dynamic button bar of about one to twelve or so buttons that change text and functionality with the current screen and/or selected record. I'm using a ButtonBar to display them.
The buttons in the bar wrap their text, when it's too large, as they should, but I end up with this dumb situation:
The buttons are different heights! I would like the ButtonBar to give me well-regulated buttons, like so:
I can cheat, after a fashion by splitting each button up into three lines. This creates a situation where the small buttons are swimming in space:
(If I use two lines, I get less wasted space, which is good, but the single-line text ceases to be centered, which also looks awful.)
Right now, the only thing I can think of to do is, after the bar renders, scan across all the buttons for the tallest one, and then adjust every other button accordingly. The ButtonBar does with width, which is good (but actually probably less desirable than all the buttons being the same height). The misleadingly named "UniformButtonSize" does this.
I'm wondering if I can do this with CSS somehow, maybe setting button heights as a percentage. Any suggestions would be appreciated!
This is a little tacky but it seems to do the trick:
public void adjustButtons() {
var tallest = 0.0;
for (Node n : buttonBar.getButtons()) {
var ht = ((Button) n).getHeight();
if (tallest < ht) tallest = ht;
}
for (Node n : buttonBar.getButtons()) {
((Button) n).setMinHeight(tallest);
}
}
So, any time the buttons in the button bar change, you fire this, it finds the tallest button, then it goes and sets all the buttons to that height.
Comments?

Drop down arrow gravity forms

Hi I have a form on this current site: http://bombyx-plm.flywheelsites.com/#contact
I wish to have drop down arrows on the two drop down fields: "Company size" & "Select subject" as you can see I have added images before the place holders. using "background: url" but in doing so I have lost the drop down arrows...
Is there anyway to have the drop down arrows with the image in the same place holder box?
Hope you can help!
Thanks
Thank you for all the responses! Sudharshan Nair had the answer I needed to create the drop down arrow.
If I understood your question correctly, you wish to add the drop-down arrow as a png arrow in the background without losing the other background image.
You should use the multi-background CSS code as in the link below:
https://www.w3schools.com/Css/css3_backgrounds.asp

XCode 5 - Constraints not always kept at runtime when using a Tab View Controller

In Xcode 5, I've opened a new project and added the following:
A Tab View Controller with two Tabs (thus two View Controllers).
In each Controller View, I've added a CollectionView, with both a Label and a Button under it.
I've applied the Default constraints. No warnings.
... clicked Run.
In the iOS simulator, the first Tab looks ok, all elements in the View are aligned to the bottom of the layout, which is the top of the tab bar. Perfect.
When clicking on the second Tab, instead of aligning to the bottom of the layout, it aligns everything to the bottom of the container. So all the elements in the View drop in height by that much. Clicking back to the first tab will now show this incorrect positioning as well.
Strangely, rotating the device fixes this... showing the correct alignments in both tabs and for both orientations.
Any idea what am I doing wrong?
Thanks,
I now believe this is a bug in XCode 5.
I got around it by replacing the constraint for a pin, like so:
Editor -> Pin -> Bottom Space to Superview.

Vertical layout of the icon and text in a JMenu

I try to find a way to place the icon of a JMenu above its text. I've seen the method setComponentOrientation(..), but it influences only the horizontal order of the icon and the text (icon on the left side, text on the right - or the opposite). Is there any possibility to place these parts of a JMenu vertically (icon on the top, text under the icon)?
I'm not sure if you are fully able to do that. Maybe this page can help you out. http://www.java-forums.org/awt-swing/36112-adding-jpanel-jmenu-focus-issues.html I have never really tried adding an image onto a JMenu vertically. You could always try using a JPanel, and adding the JMenu into it, and then setting the layout of the JPanel as a BoxLayout
JLabel imageForIcon = new JLabel(// image path );
JPanel p = new JPanel(imageForIcon);
JMenu m = new JMenu(p);
p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
I am not sure if this would work, but it seems as it could possibly be an option to consider.

iOS MonoTouch navigation middle buttons

Some Apps (like Facebook's) have buttons in the middle of the navigation section (instead of text title). How could I support right/left, and add middle button region the navigation menu, in MonoTouch?
You need to create a view or a toolbar or basically what you want that is a subclass of UIView, and add the following code.
(don't forget that you uiviewcontroller should be embedded in uinavigationcontroller)
this.NavigationItem.TitleView = YourTitleView;

Resources