标签: button

如何用 Delphi 创建一个非矩形按钮?

如何用 Delphi 创建一个透明的非矩形按钮?

delphi vcl button

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

如何使python库“ urwid”的按钮看起来漂亮?

urwid中按钮的默认外观很有用,但在我眼中却不是很漂亮。当多个按钮并排显示时,这也可能会令人不快。

如何获得一个带有边框和居中文本的按钮,并在其获得焦点时更改其颜色?

在此处输入图片说明

python tui button console-application urwid

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

c#async等待按钮单击

我是c#异步等待机制的新手.我已经检查过所有以前的async示例,等待但是它们都不像我的.我想做什么?我有一个foreach循环,我想在某个规则上停止它,做一些事情并通过点击按钮继续运行.这是一个简单的代码示例:

private void RunConvert()  // START 
{
    foreach (PartSettings File in PartsFromXLS)  // RUNING THE FOREACH LOOP ON A LIST
    {
        ProcessSinglePart(PathStep, PathMCX);
    }
}

public static async void ProcessSinglePart(string PartPathToRead, string PartPathToSave)
{
    // DO SOME STUFF BEFORE THE CHECK

    if (PartLength < PartWidth) // SOME CHECK VALUES
    {
         await WhenClicked();  //HERE I WOULD LIKE TO WAIT FOR BUTTON CLICK
    }

    //DO SOME STUFF AFTER THE CHECK
}

private void GeometryOK_Click(object sender, EventArgs e) 
{
    //  I WOULD LIKE …
Run Code Online (Sandbox Code Playgroud)

c# foreach button async-await

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

根据条款在Flutter中创建“使用Google登录”按钮

我想在Flutter应用中添加一个“使用Google登录”按钮。此按钮应符合Google 的条款。

我的问题是,我创建的按钮看起来真的很糟糕。

我使用了Google在其网站上提供的图像,但不知道我是否正确地使用了按钮的代码。

  Widget _createLoginButtonGoogle() {
    return new Expanded(
      child: new Container(
        margin: EdgeInsets.fromLTRB(30.0, 5.0, 30.0, 5.0),
        child: new RaisedButton(
          color: const Color(0xFF4285F4),
          shape: _createButtonBorder(),
          onPressed: () {},
          child: new Row(
            children: <Widget>[
              new Image.asset(
                'res/images/icons/google/btn_google_dark_normal_mdpi.9.png',
                height: 48.0,
              ),
              new Expanded(
                child: _createButtonText('Sign in with Google', Colors.white),
              ),
            ],
          ),
        ),
      ),
    );
  }
Run Code Online (Sandbox Code Playgroud)

我想要的是我的按钮看起来像原始的Google按钮

原始的Google按钮

而且不喜欢我的版本

我的Google按钮版本

谁能告诉我如何创建原始的Google按钮?有没有比创建一个更好的方法RaisedButton?

android login button dart flutter

3
推荐指数
3
解决办法
3534
查看次数

如何使用C ++在Qt中创建垂直(旋转)按钮

我想在Qt中创建一个垂直按钮(使用C ++,而不是Python),使文本顺时针或逆时针旋转90º。使用标准QPushButton似乎不可能。

我该怎么办?

c++ user-interface qt button qpushbutton

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

如何使用react-native-elements将按钮的标题向右对齐?

我正在使用react-native-elements在我的应用程序中添加按钮,但是我无法将按钮内的文本向右对齐。

我尝试了alignText:'right'的titleStyle属性,但没有成功

<Button title={'Hello World'} titleStyle={{ textAlign:'right' }} />
Run Code Online (Sandbox Code Playgroud)

我希望按钮标题向右对齐,但它只停留在中间。

button react-native react-native-elements

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

如何在SwiftUI中更改按钮的背景颜色?

在SwiftUI中更改按钮背景颜色的最佳方法是什么?

我想创建一个图块,它是一个带有居中文本和某种颜色的矩形背景的按钮。

button swiftui

3
推荐指数
4
解决办法
1311
查看次数

在SwiftUI中创建宽度和高度相同的按钮网格

我正在尝试使用创建计算器SwiftUI,我现在正在努力创建按钮网格以水平填充可用空间

现在,我只是想让按钮填充3 x 3高度和宽度相等的网格

我能够通过使用使它们相同的高度Spacer(),根据这个答案,但相同的宽度是在哪里我现在卡住权:

import SwiftUI

struct ContentView : View {
    var body: some View {
        VStack(alignment: .center, spacing: 50) {
            HStack(alignment: .center, spacing: 50) {
                Button(action: {}) {
                    Text("7")
                    Spacer()
                }.background(Color.green)
                Button(action: {}) {
                    Text("8")
                    Spacer()
                }.background(Color.yellow)
                Button(action: {}) {
                    Text("9")
                    Spacer()
                }.background(Color.green)
            }
            HStack(alignment: .center, spacing: 50) {
                Button(action: {}) {
                    Text("4")
                    Spacer()
                }.background(Color.yellow)
                Button(action: {}) {
                    Text("5")
                    Spacer()
                }.background(Color.green)
                Button(action: {}) {
                    Text("6")
                    Spacer()
                }.background(Color.yellow)
            }
            HStack(alignment: .center, …
Run Code Online (Sandbox Code Playgroud)

button swift swiftui

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

如何在SwiftUI中创建图像按钮

我有以下代码来显示图像:

struct TransactionsButtonView : View {
    var body: some View {
        return VStack {
            Image("Transactions")
            Text("Transactions")
                .font(.footnote)
            }.padding(.horizontal)
    }
}
Run Code Online (Sandbox Code Playgroud)

这样可以正确创建图像:

交易图片

但是,当我尝试将其转换为图像按钮时,它仅显示蓝色:

struct TransactionsButtonView : View {
    var body: some View {
        return VStack {
            Button(action: { self.showTransactions() }) {
                Image("Transactions")
            }
            Text("Transactions")
                .font(.footnote)
            }.padding(.horizontal)
    }

    func showTransactions() {

    }
}
Run Code Online (Sandbox Code Playgroud)

蓝色按钮

如何获得显示图像的按钮?

button imagebutton swiftui

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

当我将鼠标悬停在pygame上时,为什么我的按钮不会更改颜色?

我是pygame的新手,一直在尝试创建带有一些按钮的简单界面。当鼠标悬停在按钮上时,我无法更改按钮的颜色。

我已经成功创建了按钮,但是无法使其与鼠标交互。该代码使用一个绿色按钮实例创建一个按钮对象。当鼠标悬停在鼠标上时,应该将按钮从绿色更改为红色。

import pygame

pygame.init()

display_width = 1200
display_height = 600

black = (0, 0, 0)
white = (255, 255, 255)
red = (255, 0, 0)
green = (0, 255, 0)

StartScreen = pygame.display.set_mode((display_width, display_height))
pygame.display.set_caption('Log In')
clock = pygame.time.Clock()

StartScreen.fill(white)

class Buttons():
    def __init__(self, color, x, y, width, height, text=''):
        self.color = color
        self.x = int(x)
        self.y = int(y)
        self.w = int(width)
        self.h = int(height)
        self.text = text


    def Draw(self, StartScreen, outline=None):
        if outline:
            pygame.draw.rect(StartScreen, outline, (float(self.x-2), float(self.y-2), float(self.w+4), …
Run Code Online (Sandbox Code Playgroud)

python pygame button

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