How to vertically align text of VBox.label property in Flex 3? - flex3

How to vertically align text of VBox label property in Flex 3?
At this time I can change it only if I apply this CSS style:
LinkButton{
paddingTop: -2;
}
But applying this style affects many other components. Is there any other way?

Related

Vue.js sidebar transition

I have a sidebar and a content inside a bootstrap row and I want to animate the toggle of the sidebar and to expand seamlessly the content container, I'm applying those transition classes:
.slide-fade-enter {
transform: translateX(100%);
position: relative;
}
.slide-fade-leave, .slide-fade-leave-to {
transform: translateX(-100%);
position: absolute;
}
but it flickers when expanding, you can see it here:
https://jsfiddle.net/kd6xpa32/16/
How can I prevent this?
Looks like you're doing some dirty stuff with flex and absolute positioning. I'd find a way to leave the sidebar as always absolutely (or relatively) positioned and figure out another way to collapse+expand it. The switch between absolute and relative is causing the rendering issue.

react-native: animate height of Text component?

So I have a Text component, with a numberOfLines prop of 5. Whenever the number of lines of that component exceeds 5, it ends with an ellipse. Is there any way for me to animate the height of this Text component to show the rest of the lines that were automatically cut off?
ex.
<Text>
asldkfjaslfkdsajflkfjsadfsadifjsflsakfjfalskfjfalskfjasflkasdjfas
lifsadjfaisfjaflkafjaslfkasdjflaskfjasklsdjfasfijeifjsadlkfasdjf;a
sdkfjadsfl;kasjfasl;fadsjflaskfjas;lfasjfasdl;fjksafl;kasjfl;a
sfjasl;fkadjsf;laskjfaslfkjsafl;sadkjfl;asdkfjasdl;fjasl;fjasl
;fkjasdflksadjfalsdkfjas;lfakfjaslfkjadslfjasdlfjasl;fkjasdlf
;kajsdlf;kajsdflaks;jfasdlk;fjals;kfj
</Text>
Would give me
But I want a button clicked, and then for it to animate the height and show the rest of the text.
To show the rest of the lines you can toggle the number of lines attribute value and to smoothly animate the height you could apply a css transition to the component.
<Text class="text-animate" numberOfLines={`${!this.state.buttonClicked ? '5' : ''}`}>
asldkfjaslfkdsajflkfjsadfsadifjsflsakfjfalskfjfalskfjasflkasdjfas
lifsadjfaisfjaflkafjaslfkasdjflaskfjasklsdjfasfijeifjsadlkfasdjf;a
sdkfjadsfl;kasjfasl;fadsjflaskfjas;lfasjfasdl;fjksafl;kasjfl;a
sfjasl;fkadjsf;laskjfaslfkjsafl;sadkjfl;asdkfjasdl;fjasl;fjasl
;fkjasdflksadjfalsdkfjas;lfakfjaslfkjadslfjasdlfjasl;fkjasdlf
;kajsdlf;kajsdflaks;jfasdlk;fjals;kfj
</Text>
and
.text-animate {
transition: all .3s ease-in;
-webkit-transition: all .3s ease-in;
}
Note this depends on how react-native applies the given class within the component and and is subject to <Text/> API documentation.

NumberField text align since react-admin 2.1.3

The release 2.1.3 of react-admin introduced the use of <Typography /> for the NumberField component (and others) in place of <span />.
This component has a style to align text on the right.
const styles = {
input: { textAlign: 'right' },
};
I don't know why, but with the span element the number was aligned left.
Now the number is aligned right, but not aligned with the same margin if there are others number fields.
Code demo (Comment show screen) / Screenshot
I tried to define a className on my component...
<NumberField source="id" className="leftalign" />
with
.leftalign {
text-align: left;
}
...but the class is overridden by the style-generated class NumberField-input-234 (except if I set !important but I would like to avoid this).
My questions are:
Is there a way to align them on the left without the uggly !important css flag or writing style={{ textAlign: 'left' }} each time I use a <NumberField />?
Is there a way to align right with the same margin?
Thanks
This issue has been resolved in react-admin#2.2.0

Align QML TabView content with another item, so that tabBar overlaps with that item

I would like the actual Tab contents inside a TabView to anchor or line up to the bottom of another visual element. In this case the tabBar at the top would overlap with the other element in question.
My problem is that I don't know how to get the y coordinate of the Tab contents of the TabView or alternatively, how to get the height of the tab buttons in the tabBar so I can offset the alignment based on it.
I can think of 2 ways to solve this, both of which are clunky:
Option 1 -- I could make a TabView with no contents, which sits inside my other element. Then I could make a second TabView with tabsVisible = false. Then link the 2 together.
Option 2 -- I could override tab: in TabViewStyle, set a height for it from a property, that way I could offset my TabView.y based on the tabBar height.
Option 3: Somehow get the y coordinate of a Tab content within TabView (relative to the TabView or the parent item) or somehow get the existing tab (button) height. I have no idea how to do either of these.
Options 1 and 2 seem very clunky. Any ideas?
Actually you can get this information very easily. TabView define a contentItem property, which holds the content item of the tab view. The tab button height is therefore tabView.height - tabView.contentItem.height
Example:
import QtQuick 2.2
import QtQuick.Controls 1.1
Item {
width: 350
height: 150
TabView
{
id: tabview
height: parent.height
width: parent.width/2
Component.onCompleted: {addTab("1");addTab("2")}
}
Column
{
anchors.left: tabview.right
anchors.right: parent.right
Rectangle
{
width: parent.width
height: tabview.height-tabview.contentItem.height
color: "red"
}
Rectangle
{
width: parent.width
color: "yellow"
height: tabview.contentItem.height
}
}
}

How can I center emptyText in the middle of the screen in a List in Sencha Touch?

I recently discovered the emptyText config value for lists in Sencha Touch to display when the store is empty. The problem I am having is that this text appears in the top left corner and I can't seem to find a way to place it in the middle of the screen.
The emptyText property accepts HTML. Example:
CSS:
.emptyText {
text-align:center;
color: #999;
}
JS:
emptyText: '<div class="emptyText">No members yet</div>'
For vertical centering you will have to use the CSS3 Flexible box model
Example CSS:
//vertical and horizontal centering based on fixed height
height:200px;
display:-webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align:center;
-webkit-box-pack:center;