标签: button

iPhone - 按钮背景图像

我已经在我的应用程序中添加了一些带有背景图像的按钮(下面的RESET按钮),但角落非常符合预期.见下文:

替代文字

RESET按钮的左下角和右下角似乎是平方的.我的原始图像有圆角.

以前有人遇到过这个问题吗?

iphone button

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

`min-width`不能用于`input [type ="button"]`元素吗?

有人看到为什么这不起作用的原因?(与之合作width,但不是min-width)

input[type="button"] {
    min-width: 100px;
}
Run Code Online (Sandbox Code Playgroud)

编辑:澄清

  • "按钮"选择器可以使用width,而不是min-width
  • min-width 与其他元素一起使用,而不是"按钮"选择器
  • 这是在chrome/safari上.不是IE问题.

html css forms input button

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

Javascript - 在循环中动态分配onclick事件

我有一个非常简单的html页面与js代码:

<html>
    <head>
        <title></title>
    </head>
    <body>

        <div id="divButtons">

        </div>

        <script type="text/javascript">
            var arrOptions = new Array();

            for (var i = 0; i < 10; i++) {
                arrOptions[i] = "option" + i;
            }

            for (var i = 0; i < arrOptions.length; i++) {
                var btnShow = document.createElement("input");
                btnShow.setAttribute("type", "button");
                btnShow.value = "Show Me Option";
                var optionPar = arrOptions[i];
                btnShow.onclick = function() {
                    showParam(optionPar);
                }

                document.getElementById('divButtons').appendChild(btnShow);
            }

            function showParam(value) {
                alert(value);
            }        
        </script>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

该页面绑定了10个按钮,但是当您单击任何按钮时,它始终显示警告"option9".如何分配onclick事件来显示相应的选项!

谢谢!

html javascript events onclick button

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

表单内的图片按钮,不想提交

我有一个带有图像按钮的表单,此图像按钮正在提交表单.如何覆盖此功能?

<form><input type="image" src="/images/arrow.png" id="imageButton" onClick="javascript:autofill();"/></form>
Run Code Online (Sandbox Code Playgroud)

html forms submit button

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

按钮有两种颜色和背景图像

有没有办法设置按钮的颜色和背景图像?我想要一个带透明.png的绿色按钮,但似乎你只能拥有一个或另一个.

xml android background button background-image

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

Tkinter 中按钮的透明背景

我有一个Button带有按钮图像的图像,但是当它位于我的窗口中时,按钮的背景与窗口的背景发生冲突。它是一个 .png 图像,但tkinter似乎想通过添加灰色空间来将图像保持为四边形。有没有办法使按钮的空白区域变得透明,以便只留下按钮图像?

我在 Windows 8 上使用 Python 3.4.2。

python background tkinter button

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

Xamarin XAML按钮中的中心图标和文本

我不知道如何将图标置于按钮内并将其置于文本上方,我也没有找到有关它的信息,我被要求做一种"tabb"选项菜单,但在屏幕下方,我发现它有点"难",因为"设计含义"等,所以我决定使用按钮会更容易,但现在的问题是如何使图像居中并使文本正确,如果有人可以帮助我,那会很棒.到目前为止这是我的代码:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         BackgroundColor="Silver"
         x:Class="XamForm.View.MainPage">
<Label Text="{Binding MainText}" VerticalOptions="Center"  HorizontalOptions="Center" />


 <StackLayout Padding="30">
<Label x:Name="lblCuantos" Text="No #" TextColor="Gray" FontSize="20"/>
<Label x:Name="lblNombre" Text="" FontSize="20"/>
<Button  x:Name="btn1" Text="Oprimir" Clicked="Accion"/>
<Button  x:Name="btn2"  BackgroundColor="White" Image="iconRes.png"  HorizontalOptions="CenterAndExpand" Text="Gridd" TextColor="Gray" Clicked="Accion2"/>
<Button  x:Name="btn3"  BackgroundColor="White" Image="iconRes.png"  HorizontalOptions="CenterAndExpand"  TextColor="Gray" Clicked="Accion2"/>


</StackLayout>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)

这是按钮本身的实际结果:

http://oi59.tinypic.com/11so9le.jpg

这就是菜单的最终结果应该看起来很像

http://oi62.tinypic.com/10pzw2f.jpg

谢谢!

xaml image button xamarin

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

轮廓的 MaterialButton 不显示任何边框

我正在尝试构建一个带有边框按钮的布局,如下所示(预期行为)。从 Material design 文档中,我读到了 Outlined Material Button,它似乎非常适合我的目的。我在布局中定义了按钮,提供了笔触宽度和笔触颜色,但没有显示任何边框,我做错了什么?

<com.google.android.material.button.MaterialButton
            android:id="@+id/material_text_button"
            style="@style/Widget.MaterialComponents.Button.OutlinedButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:text="Change name"
            android:background="@android:color/transparent"
            android:textSize="12sp"
            app:layout_constraintBottom_toBottomOf="@+id/listTextView2"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/listTextView2"
            app:layout_constraintTop_toTopOf="@+id/listTextView2"
            app:strokeColor="@color/green"
            app:strokeWidth="10dp" />
Run Code Online (Sandbox Code Playgroud)

预期行为:

在此处输入图片说明

当前行为:

在此处输入图片说明

android button material-design

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

带订阅的条纹付款请求按钮

我真的厌倦了寻找我需要的信息,希望得到您的帮助。另外,我已经写信给 Stripe 支持,但目前与他们的沟通非常困难。

让我们从头开始。

我在 Laravel Cashier 中使用 Stripe 订阅。

我已经用信用卡/借记卡完成了付款。它有这样一个工作流程: - 用户填写表单;- Stripe.js 将填充的数据发送到 Stripe 服务器并返回支付方法;- 然后我将支付方法发送到我的服务器,并为有/没有试用日的用户订阅。

我需要添加 Google pay 和 Apple pay 按钮。根据关于Google pay和Apple pay的 Stripe 文档,我必须创建Payment Request Button。据我了解有关付款请求按钮的文档,它是通过这种方式工作的: - 服务器端创建 paymentIntent 并将其发送到客户端;- 用户按下支付请求按钮;- 浏览器打开一个带有保存的用户卡的弹出窗口;- 用户选择一张卡,stripe.js 立即向用户收费。

我无法理解在哪个步骤 Stripe 知道为用户进行订阅的计划 ID。

我不需要立即向用户收费,我只需要获取 paymentMethod 即可将其发送到服务器端。有没有人有使用 Payment Request 按钮进行 Stripe 订阅的经验?

我将非常感谢您的帮助。

php payment button request stripe-subscriptions

9
推荐指数
2
解决办法
1633
查看次数

如何在 ImGui 中更改输入文本的文本颜色?

我想弄清楚如何更改“名称”打印上显示的文本的颜色,但我对如何操作几乎一无所知。我想让它变成绿色,感谢帮助或提示:D

// Name
            ImGui::InputText("Name", selected_entry.name, 32);


Run Code Online (Sandbox Code Playgroud)

c++ button imgui

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