Leanback how to set vertical grid view with wrap_content height? - leanback

layout_height="wrap_content" not work.
I tyr RecyclerView by wrap_content, and it can work well,
but for VerticalGridView in Leanback, is there any other way to try?

Related

How to show several QTableViews(without scrollbar) in QListWidget(or other similar widgets)?

I have a problem with showing multiple tables(without their own scrollbars) under one scrollbar. Is there any workaround or a good way to resolve this issue in Qt?
I've tried to do what you ask, and found this. So, here is a solution:
add QScrollArea to a form
set the property widgetResizable to true
put QWidget to scroll area
right click on widget -> Set ancestor -> [your scroll area]
add vertical layout to a widget
scroll area will collapse, epand it with a mouse
insert into the widget as many tables as you want
set vertical size policy for each table to Minimum and set minimal vertical size.
Here is how it looks:

Qt-Creator - Trouble resizing widgets within QTabWidget

I am having trouble horizontally resizing a QTableWidget within a QTabWidget.
If the QTableWidget is on its own in my MainWindow, it resizes horizontally without any problems (or limits). As soon as I place the QTableWidget inside the QTabWidget I seem to hit a maximum width for the QTablewidget. I can resize it horizontally, but only so far. I do not seem to have this limitation vertically.
My sizePolicies are set to Expanding for both directions.
Anyone have any ideas?
Thanks!
EDIT:
I took some screenshots to try and clear things up. The 'QTableWidget' that is not within the 'QTabWidget' stretches much further horizontally.

UISearchBar in UINavigationBar changes width when rotating orientation

This is driving me crazy. I am creating a splitview app on iPad.
I have created a searchBar inside the UINavigationBar - something like this...
UISearchBar *searchBar = [[UISearchBar alloc] initWitFrame:CGRectZero];
[searchBar setPlaceHolder:#"Search"];
[searchBar sizeToFit];
[searchBar setDelegate:self];
[self.navigatioItem setTitleView:searchBar];
this works just fine for me displaying the UISearchBar like this...
I also have this UIBarButtonItem set to show Master navigation controller in sidepane.
The problem happens when the device rotates to landscape and the UIBarButtonItem gets hidden. Then the searchBar appears like this...
there is some space on sides which appears to be there since the barButtonItem got hidden and the size of search bar couldn't be updated.
Furthermore, when I rotate the device again, here's what happens to UISearchBar
How can I update the size of searchbar once it has been added to UINavigationBar. Even using autoResizingMask does not work.
searchBar.autoResizingMask =UIViewAutoresizingFlexibleWidth;
What am I doing wrong over here?
I had about the same problem (it wasn't searchbar, but some UIView), and that's how I solved it:
Try creating it with fixed size that won't change. I mean if your navbar minimum size is (for example) 320pt, and barbutton is about 30pt, and you need searchbar to be placed right in the middle (which, BTW is not standart, AFAIK), you'd have to make it 320 - (30+10)*2 = 240pt. Searchbar would be placed right in the middle and will have enough place left free.
This way it will neither change it's size, nor it will affect other items.
Or I would suggest you placing it at right position, not in the middle.
Hope it helped.

Qt: Transparent scrollbar

I'd like to make a background of a scrollbar of QListView transparent. It should be painted over the content. Something like this. Is it possible?
Sure. Subclass it, override the paint event, and read this.
GUI style on screenshot is QML i think
I ended up with this hack. I just created a new vertical scroll bar, placed it onto viewport and connected it with the original scroll bar. Then I just hidden the original scrollbar :)
You can see the result: http://i.stack.imgur.com/wrQOQ.png

Flex scrollbar styling issue

I'm trying to style vscrollbar and hscrollbar inside a Vbox.But there's always a white square thing at the right bottom cornor which can not be styled.
My CSS is:
ScrollBar{
downArrowUpSkin: Embed(source="assets/images/scrollbar/arrow_down.png");
downArrowOverSkin: Embed(source="assets/images/scrollbar/arrow_down.png");
downArrowDownSkin: Embed(source="assets/images/scrollbar/arrow_down.png");
upArrowUpSkin: Embed(source="assets/images/scrollbar/arrow_up.png");
upArrowOverSkin: Embed(source="assets/images/scrollbar/arrow_up.png");
upArrowDownSkin: Embed(source="assets/images/scrollbar/arrow_up.png");
thumbDownSkin: Embed(source="assets/images/scrollbar/thumb.png");
thumbUpSkin: Embed(source="assets/images/scrollbar/thumb.png");
thumbOverSkin: Embed(source="assets/images/scrollbar/thumb.png");
trackSkin:Embed(source="assets/images/scrollbar/track.png");
fillAlphas:0,0,0,0;}
Could anyone help me out?Much Thanks!
This is a weird one. The white box at the bottom right is actually a (raw) child of the container.
To get around this you need to subclass whatever container you want to add your styled scrollbars to and remove the child called "whitebox":
var whitebox:DisplayObject = rawChildren.getChildByName('whiteBox');
if (whitebox)
rawChildren.removeChild(whitebox);
IIRC you need to do the above in two places: an override of createChildren and an override of validateDisplayList. In both cases remember to call the super class method first!
That area isn't controlled by the scroll bar(s), it's part of the original container. Does the VBox have it's background colour set to black?

Resources