标签: label

在小网格/面板内旋转文本

<Label Grid.Row="1"
       Height="70"
       Margin="2"
       Width="300"
       Content="{l:Translate Key={x:Static l:MultistringTags.SHOW_MENU}}"
       DockPanel.Dock="Bottom"
       FontSize="20"
       FontWeight="Bold"
       Foreground="White">
       <Label.RenderTransform>
           <RotateTransform Angle="270" />
       </Label.RenderTransform>
</Label>
Run Code Online (Sandbox Code Playgroud)

这里我想旋转文本,它位于网格内,网格列宽等于文本高度。在这种情况下,我只能看到部分文本,就像绘制文本时没有按网格宽度旋转切割并旋转到所需角度一样。我尝试过面板,它们给了我相同的结果。

有谁知道一些解决方法可以让它显示所有文本,我不想使用图像,因为文本应该是可翻译的。

wpf grid xaml label stackpanel

1
推荐指数
1
解决办法
1459
查看次数

ExtJs 3.4:设置标签边框、中心标签文本和粗体标签文本

我在字段集中有一个 ExtJs 标签,并且我正在使用 ExtJs 3.4。

{
                xtype : 'fieldset',
                layout : 'hbox',
                border : false,
                defaults : {
                    //layout : 'hbox',
                    labelAlign : 'center'
                },
                items : [ {
                    xtype : 'label',
                    id : 'idOpen',
                    text : '',
                    width : 52.5,
                    height : 25,
                    labelStyle : 'font-weight:bold;',
                    border : true,
                    style : {
                        //background : '#6699FF',
                        color : 'black',
                        textAlign: 'center'
                    }
                }.......
Run Code Online (Sandbox Code Playgroud)

我需要为该标签添加边框和粗体标签文本。我尝试过border : true但它不起作用。

labelStyle : '字体粗细:粗体;' 也不工作。

我还需要将标签文本置于标签框中的中心。我试过了

style : {

                        textAlign: 'center'
                    }
Run Code Online (Sandbox Code Playgroud)

它将文本水平居中,但不垂直居中。 …

javascript label extjs

1
推荐指数
1
解决办法
2万
查看次数

如何合并 tkinter 标签中不同颜色的文本

我正在用 tkinter 标签编写一个小股票行情显示程序,我需要将红色和绿色的文本合并到同一行中。我怎样才能做到这一点?

如果没有,我可以用其他小部件来实现吗?

python label tkinter colors

1
推荐指数
1
解决办法
9917
查看次数

为什么我的标签显示“你的猫是可选的(35)岁”,而它应该显示“你的猫是 35 岁?

Swift 新手,我遇到了一个令人沮丧的问题。该程序正确编译并运行而不会崩溃。该程序应该根据用户输入的人类年数计算猫的年龄(以猫年为单位)。然而,按下按钮后,结果会显示“运算符”一词,并附加以括号分隔的猫年,即Optional(35)。这是我的代码:

@IBOutlet weak var getHumanYears: UITextField!
@IBOutlet weak var displayCatYears: UILabel!
@IBAction func calculateCatYears(_ sender: Any) 
{
    if let humanYears = getHumanYears.text
    {
        var catYears: Int? = Int(humanYears)
        catYears = catYears! * 7
        let catYearsString: String = String(describing: catYears)

        displayCatYears.text = "Your cat is " + catYearsString + " years old"
    }
}
Run Code Online (Sandbox Code Playgroud)

有谁知道我做错了什么?感谢您的宝贵意见!

label type-conversion ios swift

1
推荐指数
1
解决办法
530
查看次数

在 Woocommerce 3 中更改运输方式标签名称

我已将 USPS 的两个运输选项添加到我的 Wordpress 网站:priority mailfirst-class package service. 这些选项分别在购物车和结帐页面上显示为“一流的包裹服务”“优先邮件”

我发现标题都有点笨重,并希望将它们更改为分别在购物车和结帐页面上读取“标准”和“优先级”。

关于我需要添加什么代码来实现这一点的任何想法?

php wordpress label shipping woocommerce

1
推荐指数
1
解决办法
5714
查看次数

如何用ggplot2标记boxplot的异常值?

我的数据如下:

genes   fc   type
349028  -1.2 pro
2454    1.1  pro
24908   0.4  pro
4730    0.8  pro
94988   0.9  pro
9865    6    pro
8935    3.4  phos
39280   1.2  phos
8034    -0.3 phos
3953    1.1  phos
4732    2.1  phos
Run Code Online (Sandbox Code Playgroud)

我想用 ggplot2 标记 boxplot 的异常值并用“抖动”绘制所有点,但异常值出现两次。我的代码如下:

genes   fc   type
349028  -1.2 pro
2454    1.1  pro
24908   0.4  pro
4730    0.8  pro
94988   0.9  pro
9865    6    pro
8935    3.4  phos
39280   1.2  phos
8034    -0.3 phos
3953    1.1  phos
4732    2.1  phos
Run Code Online (Sandbox Code Playgroud)

我得到了图:在此处输入图片说明

如果我添加 …

label r ggplot2

1
推荐指数
1
解决办法
3913
查看次数

为什么我无法删除此标签 (Tkinter)

我只是在玩弄和测试 python 中的东西。对于更大项目的概念验证代码的一部分,我需要创建然后删除标签。不幸的是,在我创建标签然后尝试将其删除后,当我尝试.destory()使用标签时出现此错误:

AttributeError: 'NoneType' object has no attribute 'destroy'

我听说如果你的标签中没有任何内容,你会得到这个错误,所以它是“无”,但我的有文字。这是代码:

from tkinter import*
import random
import time

root = Tk()
root.geometry("800x500")
root.title("amazing")

def one():
    label1 = Label(root, text="one", font=("Comic Sans MS", 30),  fg="purple").pack()
    time.sleep(2)
    label1.destroy()

def two():
    label2 = Label(root, text="two", font=("Comic Sans MS", 30),  fg="purple").pack()
    time.sleep(2)
    label2.destroy()

def doit():
    rchoice = [two, one]
    selected = random.choice(rchoice)
    return selected()

Button = Button(root, text="Button", width=15, height=3, font=("Comic Sans MS", 20), fg="blue", bg="lightgreen", command=doit).pack(pady=50)

root.mainloop()
Run Code Online (Sandbox Code Playgroud)

python label tkinter destroy

1
推荐指数
1
解决办法
341
查看次数

更改标签颜色 TextInput 反应原生纸 onFocus

如何在聚焦时更改 textInput 的标签颜色。我使用 react-native-paper 默认情况下它是紫罗兰色,是否有任何类似 labelColor 的道具来做同样的事情当单击 textInput 进行编辑时,需要更改 TextInput 的标签颜色。详情请看以下代码

import React, {Component} from 'react'
import { View, StyleSheet } from 'react-native'
import { Text, TextInput, Card, Button } from 'react-native-paper'

class login extends Component {
    state = {
        email: '',
        password: ''
    }
    handleEmail = (text) => {
        this.setState({email: text})
    }
    handlePassword = (text) => {
        this.setState({password: text})
    }
    render(){
        return (
            <View style = {styles.container}>
            <View style = {styles.part1}/>
            <View style = {styles.part2}/>
            <View style = {styles.CardContainer}> …
Run Code Online (Sandbox Code Playgroud)

label react-native react-native-paper

1
推荐指数
1
解决办法
5012
查看次数

R 堆叠百分比条形图,带有 ggplot 的两个因子变量的百分比

我试图绘制两个因子变量,并在图中用 % 标记结果。

我已经检查了这篇文章和他/她提供的链接:

如何将堆积百分比条形图标签居中

您在这里看到的 ggplot 行实际上来自推荐的帖子之一:

sex <- c("F","F","M", "M", "M", "F","M","F","F", "M", "M", "M", "M","F","F", "M", "M", "F")
behavior <- c("A", "B", "C", "A", "B", "C", "A", "B", "C", "A", "B", "C", "A", "B", "C", "B", "C", "A")

BehSex <- data.frame(sex, behavior)

ggplot(BehSex, aes(x= factor(sex), fill= factor(behavior), y = (..count..)/sum(..count..)))+
  geom_bar() +
  stat_bin(geom = "text",
          aes(label = paste(round((..count..)/sum(..count..)*100), "%")),
          vjust = 5)
Run Code Online (Sandbox Code Playgroud)

但是,当我使用该行时,出现以下错误:

错误:StatBin 需要一个连续的 x 变量:x 变量是离散的。也许你想要 stat="count"?

我尝试在 geom_bar() 中使用 stat="count" 但它似乎没有按预期工作。

三个问题:
1)我做错了什么?
2)我怎样才能绘制出我想要的图? …

label r bar-chart ggplot2 geom-bar

1
推荐指数
1
解决办法
2378
查看次数

ValueError:logits 和标签必须具有相同的形状 ((None, 4) vs (None, 1))

我尝试制作一个卷积神经网络来对狗和猫进行分类。我在标题中提到了错误。

根据我的搜索,有人说错误属于不同版本的tensorflow和keras库,有人说是语法错误。我会在这里留下我的代码,告诉我我哪里出错了。

#IMPORTING LIBRARIES
import tensorflow as tf
import pandas as pd
import keras
from keras.preprocessing.image import ImageDataGenerator



#IMAGE DATA PREPROCESSING

#preprocessing the training set
train_datagen = ImageDataGenerator(
        rescale=1./255,
        shear_range=0.2,
        zoom_range=0.2,
        horizontal_flip=True)
training_set = train_datagen.flow_from_directory(
        directory = r"C:\Users\Cucu\Downloads\training_set",
        target_size=(64 , 64),
        batch_size=32,
        class_mode='binary')

#preprocessing the test set
test_datagen = ImageDataGenerator(rescale=1./255)
test_set = test_datagen.flow_from_directory(
        directory = r"C:\Users\Cucu\Downloads\test_set",
        target_size=(64 , 64),
        batch_size=32,
        class_mode='binary')


 
#BULDING THE CNN
#
#
#initialising the cnn
cnn = tf.keras.models.Sequential()


#convolution
cnn.add(tf.keras.Input(shape=(64, 64, 3)))
cnn.add(tf.keras.layers.Conv2D(filters = 32 , …
Run Code Online (Sandbox Code Playgroud)

python label conv-neural-network valueerror logits

1
推荐指数
1
解决办法
1279
查看次数