我有一个里面有图片的标签。我想应用一个简单的动画:在加载标签后(或何时可见或其他)更改不透明度属性以实现淡入效果
但这不起作用:
<Label ContentTemplate="{DynamicResource ImageLabelDataTemplate}" Canvas.Left="36" Canvas.Top="394" Height="116" Name="PreviousVirtualButton" Width="100" Visibility="Hidden">
<Label.Style>
<Style TargetType="Label">
<Style.Triggers>
<Trigger Property="IsVisible" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard TargetProperty="Opacity">
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:5" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
Run Code Online (Sandbox Code Playgroud)
我想看看标签是如何在屏幕上淡入的。
提前致谢。
我有一个标签为"Name"的自定义UIButton.当用户单击此按钮时,它会加载另一个显示名称列表的视图,并点击一个名称会弹出此视图,并使用所选名称更新UIButton.
那部分有效.如果用户没有从View中选择一个名称,而只是点击Back,那么什么不起作用.弹出视图,但现在删除了UIButton文本"Name",按钮文本完全空白. 如何阻止文本标签被删除?
我没有任何更新UIButton标签的代码,除非轻敲一行(didSelectARowAtIndexPath),所以我不明白在加载新视图时如何清除标签"Name".请注意,我有三个具有相似功能的按钮,并且在轻敲时只会删除相应按钮的文本 - 其他两个按钮不受影响.
我创建了一个spark.components.Label,我想更改文本对齐方式.该API指出它有一个属性textAlign设置,但我得到这个错误.我究竟做错了什么?
import spark.components.Label;
var mylabel:Label = new Label();
mylabel.textAlign = "right";
Run Code Online (Sandbox Code Playgroud)
错误:访问可能未定义的属性textAlign通过带有静态类型spark.components:Label的引用.
我无法更新我的 WinForm 标签属性。
详细信息:我正在尝试检查我的数据库并发布一些值,但似乎我什至无法仅更新标签。我正在使用 SharpDevelop。
编码:
//this is my form
public partial class MainForm : Form
{
//Declaring timer
public static System.Timers.Timer aTimer = new System.Timers.Timer();
public MainForm()
{
InitializeComponent();
//Timer
aTimer.Elapsed +=new ElapsedEventHandler(OnTimedEvent);
aTimer.Interval = 2000; //milisecunde
aTimer.Enabled = true;
label1.Text="some_text";
}
private static void OnTimedEvent(object source, ElapsedEventArgs e) {Check();}
public static void Check()
{
//Database checks here..
try{label1.Text="new_text";}catch(Exception e) {MessageBox.Show(e.ToString());}
MessageBox.Show("BAAAA");
}
void Button1Click(object sender, EventArgs e)
{
label1.Text = "mergeeeeee?!";
}
}
Run Code Online (Sandbox Code Playgroud)
编辑:我已经删除了所有静态修饰符。还用新代码更新了帖子(添加了 try catch 和后面的消息框 + …
我正在尝试在淡入和淡出之间更改标签的文本,如下所示:
Label label = (Label) this.cardsValueGroup.getChildren().get(1);
label.textProperty().set(String.valueOf(cardsValue));
SequentialTransition t = new SequentialTransition();
if (this.cardsValueGroup.getOpacity() == 1.0) {
FadeTransition fadeOut = new FadeTransition(Duration.seconds(0.5), this.cardsValueGroup);
fadeOut.setFromValue(1.0);
fadeOut.setToValue(0.0);
t.getChildren().add(fadeOut);
}
FadeTransition fadeIn = new FadeTransition(Duration.seconds(0.5), this.cardsValueGroup);
fadeIn.setFromValue(0.0);
fadeIn.setToValue(1.0);
t.getChildren().add(fadeIn);
t.play();
Run Code Online (Sandbox Code Playgroud)
如何添加标签文本过渡?
我目前正在通过 NASM 汇编器学习汇编,但我陷入了section和label之间的区别。我知道section .dat, .bssor.text被用作变量声明或初始化的标准以及作为链接器钩子,例如main()在 C 中。而且,标签用于分配代码中的一个
部分。那么这背后有什么不为人知的真相呢?
我的目标很简单 - 当切换开关时,打开和关闭(红色或绿色)我的勾选/交叉切换.
我尝试了很多jQuery的变种,但由于某种原因没有任何作用.
这是一个JSFiddle的链接:http://jsfiddle.net/t7nep473/
HTML:
<div class="three columns">
<label class="toggle">
<i class="fa fa-close toggle-off active"></i>
<input type="checkbox" class="toggle-input">
<div class="toggle-controller default-success"></div>
<i class="fa fa-check toggle-on"></i>
</label><!-- END .toggle -->
</div><!-- END .three.columns -->
Run Code Online (Sandbox Code Playgroud)
CSS:
.toggle {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: block;
height: auto;
width: 7.5rem;
margin: auto;
cursor: pointer;
}
.toggle-input {
display: none;
margin: 0;
}
.toggle-off,
.toggle-on {
height: 1.8125rem;
width: 1.8125rem;
color: rgba(46, 45, 44, 0.1);
vertical-align: top;
text-align: center; …Run Code Online (Sandbox Code Playgroud) 我有一个字符串:“制作牙膏和漱口水的想法”。
我使用波纹管代码来获取 label 上的最后一个字符串。结果字符串最后一行:“和漱口水”。但是标签显示的最后一行:“牙膏和漱口水”如何在标签上准确获取最后一行的字符串?这是我的代码:
-(NSArray *)getLinesArrayOfStringInLabel:(UILabel *)label
{
NSString *text = [label text];
UIFont *font = [label font];
CGRect rect = [label bounds];
CTFontRef myFont = CTFontCreateWithName((__bridge CFStringRef)([font fontName]), [font pointSize], NULL);
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:text];
[attStr addAttribute:(NSString *)kCTFontAttributeName value:(__bridge id)myFont range:NSMakeRange(0, attStr.length)];
CTFramesetterRef frameSetter = CTFramesetterCreateWithAttributedString((__bridge CFAttributedStringRef)attStr);
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddRect(path, NULL, CGRectMake(0,0,rect.size.width,100000));
CTFrameRef frame = CTFramesetterCreateFrame(frameSetter, CFRangeMake(0, 0), path, NULL);
NSArray *lines = (__bridge NSArray *)CTFrameGetLines(frame);
NSMutableArray *linesArray = [[NSMutableArray alloc]init];
for (id line in …Run Code Online (Sandbox Code Playgroud) 我有一个问题,即使使用JavaScript中的labelColor属性,标签仍将保持黑色,但我想让它变成白色是否有任何方法可以这样做?也许是一种解决方法?
for (i = 0; i < locations.length; i++) {var myLatLng = new google.maps.LatLng(locations[i][1], locations[i][2]);
marker = new google.maps.Marker({
position: myLatLng,
map: map,
label: labels[i],
labelClass: "labels", // the CSS class for the label
labelColor: '#fff',
labelInBackground: false,
icon: locations[i][4]
});
Run Code Online (Sandbox Code Playgroud)
问题是我有自己想要使用的自定义图标,我不想先创建一些SVG.感谢任何可以帮助我的人.
javascript label google-maps google-maps-api-3 google-maps-markers
我试过在互联网上寻找解决我的问题。但它根本没有结果。所以。请查看此代码示例:
class RootWidget(FloatLayout):
def __init__(self, **kwargs):
super(RootWidget, self).__init__(**kwargs)
btn = Button(text='Hello world')
btn.size_hint = (1, .3)
btn.pos_hint = {'top':1}
title = Label(text=('[color=ff3333]Hello world[/color]'),
font_size=str(12) + 'sp', markup=True)
self.add_widget(title)
self.add_widget(btn)
title.texture_update()
title.text_size = (Window.width, None)
title.height = title.texture_size[1]
with title.canvas:
Color(1., 1., 0)
Rectangle(size=title.size, pos=title.pos)
print(title.size)
print(title.pos)
print(title.texture_size)
Run Code Online (Sandbox Code Playgroud)
现在看看图像:

谁能告诉我为什么打印(title.pos)说(0,0),画布在(0,0)处绘制矩形但文本出现在另一个位置?
我已经被这个淹没了......
谢谢你。
label ×10
ios ×2
actionscript ×1
animation ×1
apache-flex ×1
assembly ×1
google-maps ×1
javafx ×1
javascript ×1
jquery ×1
kivy ×1
nasm ×1
objective-c ×1
python ×1
sections ×1
transitions ×1
triggers ×1
uibutton ×1
winforms ×1
wpf ×1