can I add a value label for a Zii progress bar?
$w =intval($model->fixed);
$this->widget('zii.widgets.jui.CJuiProgressBar', array(
'value'=> $w ,
'htmlOptions'=>array(
'style'=>'width:200px;height:20px;',
),
));
Regards.
Modify like this to put label to your progress bar
$w =intval($model->fixed);
$this->widget('zii.widgets.jui.CJuiProgressBar', array(
'id'=>'jui_progress_bar',
'value'=> $w ,
'htmlOptions'=>array(
'style'=>'width:200px;height:20px;',
),
'options'=>array(
'create'=>new CJavaScriptExpression('function(event, ui) {
$("jui_progress_bar").text("Your Text goes here");
}'),
)
);
Related
I implemented numberpicker in my app.
I would like to modify the size of the numbers and the color of both highlighted value and those who are not. I managed to modify the highlighted ones wrapping it in the Theme widget and modifing the accentcolor, but don't know how I can do the other customizations?
Theme(
data: Theme.of(context).copyWith(
accentColor: Colors.red,
),
child: NumberPicker.integer(
initialValue: _currentPickerValue,
minValue: 0,
maxValue: 100,
onChanged: (newValue) =>
setState(() => _currentPickerValue = newValue)))
I digged into the code and here is something that I found
selectedStyle = themeData.textTheme.headline.copyWith(color: themeData.accentColor);
defaultStyle = themeData.textTheme.body1; This is ones which are not highlighted
to change the size or color or any other style attribute modifiy those style.
here is an example code:
final theme = Theme.of(context);
Theme(
data: theme.copyWith(
accentColor: Colors.black,// highlted color
textTheme: theme.textTheme.copyWith(
headline5: theme.textTheme.headline5.copyWith(..), //other highlighted style
bodyText2: theme.textTheme.headline5.copyWith(...), //not highlighted styles
)),
child: NumberPicker.integer(...),
);
Update your number picker package to the latest version.
new NumberPicker.integer(
...,
selectedTextStyle: TextStyle(...),
textStyle: TextStyle(...), //styles of the default text
)
Visit NumberPickec class for study properties.
My widget tree looks like this:
showModalBottomSheet(... => WidgetTree()); // this symbolizes that I pass exactly what you can see below into the builder function
// WidgetTree
Row(
children: [
Text('some string') // if this string is long enough, it will overflow instead of displaying on a second line
]
);
Above you can see the Modal Bottom Sheet.
As you can see, the Text does not expand over the next lines, like it does in other scenarios, but I get a RenderFlex OVERFLOWING error.
You can make use of the Wrap widget:
// WidgetTree
Wrap(
children: [
Text('some string') // if this string is long enough, it will overflow instead of displaying on a second line
]
);
I'm trying to create a bottom navigation bar like the Twitter app has, but I can't find how to customize the highlightShape size.
I can customize corners, colors but not size, I would like to make same size which exceed the bounds of the widget like splash in my builder.
Here is how look my bottom navigation button. Thank you! for help in advance.
Center(
child: Ink(
height: height,
width: width,
child: InkResponse(
splashFactory: InkRipple.splashFactory,
radius: radiusSize,
onTap: () {
const int itemIndex = 1;
_onTapped(itemIndex);
},
child: _pageIndex == 1
? Icon(OMIcons.favoriteBorder, color: Colors.black, size: 28.0)
: Icon(OMIcons.favoriteBorder, color: Colors.grey[600]),
),
),
),
This may be an old question but, the "max" radius should match the normal radius if no radius property is specified.
To change the normal radius you should create a custom splashfactory , https://stackoverflow.com/a/51116178/10205629 .
Or as a little hack you could copy the source code and create your own inkresponse modifying the values
So I am looking to customize the TabBarIOS ui a little bit. Right now the TabBar has an icon field and a name field:
iconName="ios-pin"
title="Map"
Using these results in something like this (with the icon above the text):
However I am trying to get something that looks a like this (with the icon next to the text p.s sorry for the crappy image)
Does anyone have any idea how to do this? Below is my current TabBarIOS code.
Thanks!
renderScene(route, navigator) {
return (
<TabBarIOS
translucent={false}
unselectedTintColor="white"
tintColor="#f9c827"
barTintColor="#2c2c2c">
<Icon2.TabBarItemIOS
iconName="ios-pin"
title="Map"
selectedIconName="ios-pin"
selected={this.state.selectedTab === 'MapTab'}
onPress={() => {
this.setState({
selectedTab: 'MapTab',
});
}}>
{this.renderMap(route, navigator)}
</Icon2.TabBarItemIOS>
<Icon2.TabBarItemIOS
iconName="ios-list-box-outline"
title="List"
selectedIconName="ios-list-box-outline"
selected={this.state.selectedTab === 'ScrollTab'}
onPress={() => {
this.setState({
selectedTab: 'ScrollTab',
toolbar: YELLOW,
navigationBar: NavigationBarYellow,
});
}}>
{this.renderScrollView(route, 'ScrollTab')}
</Icon2.TabBarItemIOS>
</TabBarIOS>
);
}
The simplest way is to use images with text, the other one is to create container viewcontroller and use UIView instead of UITabbar.
That view should have two buttons with icons and texts that you need.
I only want to color the caption text, and not the entire caption box (or background).
Before Imagemagick 6.3.7 I could use this code to have a red colored text :
$im->newPseudoImage(300, 300, "caption:" . "Put your text" );
$im->colorizeImage('#ff0000',1.0);
I have upgraded because I need to set a font and a font size with the following code :
$im->setFont("somefont.ttf");
$im->setpointsize(72);
Now colorizeImage does not work the same way, as it doesnt' color only the caption TEXT but the caption BACKGROUND also ..!
For example if I set a black background and a white text :
$im->newPseudoImage(300, 300, "caption:" . "Put your text" );
$im->setBackgroundColor('black');
$im->colorizeImage('white',1.0);
I have a white background behind a white text, or a white box (the color of the text for the box) !
I tried different things, setBackgroundColor before or after colorizeImage, still the same... I've made lots of researches but found nothing else to color the caption and the background caption separately.
Anybody with an idea to help me ? Thx in advance :)
You want a transparent background. Then you will only color the foreground.
Use clutImage to apply the color. colorizeImage has issues with applying a slightly darker color when replacing black.
$im = new Imagick();
$im->newPseudoImage(300, 300, "caption:" . "Put your text" );
$im->setBackgroundColor('transparent');
$clut = new Imagick();
$clut->newImage(1, 1, new ImagickPixel('#ff0000'));
$txt->clutImage($clut);
$clut->destroy();
Not sure if this is what you want but this gives me white text on a black background:
$width = '600';
$height = '200';
$im = new Imagick();
$draw = new ImagickDraw();
$draw->setFont('arial.ttf');
$draw->setFontSize( 96 );
$fillcolor = new ImagickPixel( "white" );
$draw->setFillColor( $fillcolor );
$draw->setGravity( Imagick::GRAVITY_CENTER );
$bgcolor = new ImagickPixel( "black" );
$text = 'Rubblewebs';
$im->newImage($width, $height, $bgcolor );
$im->annotateImage($draw, 0, 0, 0, $text);
$im->setImageFormat("png");
$im->writeImage( 'text.png' );