button 相关问题

按钮是图形用户界面中的简单元素,可以将鼠标点击或手指点击(在移动设备上)作为输入。

Plotly Dash 函数切换图形参数 - python

我正在尝试安装一个提供开关或切换来更改绘图的功能。使用下面的内容,我有一个散点图和两个按钮,用于更改点的颜色和大小......

回答 1 投票 0

Python - Reddit(可点击按钮)

我想在 selenium python 脚本中制作点击帖子下的“Upvote”。 driver.find_element(By.XPATH, '//*[@id="t3_1crzl6x"]//div[2]/span/span/button[1]').click() 但到目前为止我所理解的...

回答 1 投票 0

从 CSS 按钮中删除轮廓[重复]

目前,我的下拉菜单中的按钮在每个按钮周围显示黑色轮廓(如图所示),但我正在尝试删除它们,以便按钮看起来与背景更加融合......

回答 1 投票 0

如何禁用JFrame窗口菜单栏中的图标化按钮?

如何禁用 JFrame 窗口中的图标化按钮? 类似于 setResizable,但用于最小化按钮

回答 3 投票 0

从另一个选项卡复制按钮

我当前有一个宏的一部分,当您单击选项卡 A 上的按钮时,该宏会运行。 ActiveSheet.Shapes.Range(Array("按钮 36")).Select 选择.复制 ActiveSheet.Buttons(Application.Caller).

回答 1 投票 0

如何在 MAUI Windows 应用程序的标题栏中放置按钮

我想在我的 MAUI Windows 应用程序上的弹出菜单图标旁边的标题栏中放置一个刷新按钮。 这是我想要做的事情的屏幕截图: 作为解决方法,我将其放置在 Shell.TitleVie 中...

回答 1 投票 0

点击cookie按钮但结果不一致

我目前正在尝试抓取以下页面。 我在单击 cookie 按钮时遇到问题,因为它运行不一致。在某些运行中,单击按钮并且该过程按应有的方式继续...

回答 1 投票 0

如何使按钮拉伸到列的宽度

我正在尝试使按钮跨越列的宽度。 例如这里:http://davidnhutch.com。请注意,浅灰色按钮的大小仅与它们包含的文本一样大?我希望每个按钮都能水疗...

回答 3 投票 0

热衷于在毛伊岛 Windows 应用程序的标题栏中放置一个按钮

我想在弹出菜单图标旁边的标题栏中放置我的 maui windows 应用程序的刷新按钮。 这是我想要做的事情的屏幕截图: 截屏 作为解决方法,我将其放入外壳中。

回答 1 投票 0

Excel 功能区按钮切换按钮:缩小以适合(文本)

这是一个切换按钮,用于打开/关闭“缩小以适合”文本。 问题:无法正确刷新。 如何构建它以始终“显示”活动细胞的状态? '——XML ...

回答 1 投票 0

Javascript 中单个 ON/OFF 类型按钮出现问题

我会先说我正在尝试学习 JS。 我目前正在尝试制作一个按钮,单击时隐藏 GIF(或其他移动图像),然后更改为“显示 GIF”按钮...

回答 1 投票 0

这是一个很好的 HTML 实践吗?

这是 HTML 中的一个好习惯吗??? 加上 了解更多 要添加...

回答 1 投票 0

没有背景/边框的图像按钮? [已解决]

我一直在尝试从图像制作一个按钮,但我不知道如何从中删除边框和背景。有什么办法可以让图像充当按钮吗? 这是我当前的按钮...

回答 2 投票 0

没有背景/边框的图像按钮?

我一直在尝试从图像制作一个按钮,但我不知道如何从中删除边框和背景。有什么办法可以让图像充当按钮吗? 这是我当前的按钮...

回答 1 投票 0

为什么按钮上不显示边框?

我正在 Android Studio 中构建一个应用程序,我试图在按钮周围添加边框。 具体来说,这是一个我试图将其添加到的按钮: 我正在 Android Studio 中构建一个应用程序,并尝试在按钮周围添加边框。 具体来说,这是一个我试图将其添加到的按钮: <Button android:id="@+id/activitiesButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/activities" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/healthBeautyButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/mbCardButton" tools:ignore="VisualLintButtonSize" /> 这是整个文件 actvity_home.xml 的代码: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" style="@style/ButtonStyle" tools:ignore="SpeakableTextPresentCheck"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" tools:context=".HomeActivity" tools:ignore="Overdraw" android:layout_height="wrap_content"> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/virtual_card" android:textColor="#FEBE0F" android:textSize="27sp" android:textStyle="bold" android:gravity="center_horizontal" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="20sp" app:autoSizeMaxTextSize="25sp" app:autoSizeStepGranularity="1sp" android:paddingTop="10dp" android:paddingBottom="10dp" app:layout_constraintBottom_toTopOf="@+id/mbCardButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:ignore="TextSizeCheck" /> <ImageView android:id="@+id/mbCardButton" android:layout_width="0dp" android:layout_height="0dp" android:contentDescription="@string/mane_benefits_logo" app:layout_constraintBottom_toTopOf="@+id/activitiesButton" app:layout_constraintDimensionRatio="W,2:1" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView" app:srcCompat="@drawable/mb_card" tools:ignore="SpeakableTextPresentCheck,DuplicateSpeakableTextCheck,ImageContrastCheck" /> <Button android:id="@+id/activitiesButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/activities" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/healthBeautyButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/mbCardButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/healthBeautyButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/health_beauty" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/restaurantsButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/activitiesButton" tools:ignore="TextSizeCheck,VisualLintButtonSize" /> <Button android:id="@+id/restaurantsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/restaurants" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/retailButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/healthBeautyButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/retailButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/retail" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/servicesButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/restaurantsButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/servicesButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/services" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/sevenPointsButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/retailButton" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/sevenPointsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" style="@style/ButtonStyle" android:text="@string/_7_points" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/mbLogo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/servicesButton" tools:ignore="VisualLintButtonSize" /> <ImageView android:id="@+id/ffcuLogo" android:layout_width="64dp" android:layout_height="74dp" android:layout_marginStart="0dp" android:layout_marginTop="0dp" android:layout_marginEnd="0dp" android:layout_marginBottom="20dp" android:contentDescription="@string/ffcu_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/mbLogo" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/ffcu_logo" /> <ImageView android:id="@+id/mbLogo" android:layout_width="64dp" android:layout_height="74dp" android:layout_marginStart="0dp" android:layout_marginEnd="0dp" android:layout_marginBottom="20dp" android:contentDescription="@string/mane_benefits_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/fbButton" app:layout_constraintStart_toEndOf="@+id/ffcuLogo" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/mb_logo_new" /> <ImageButton android:id="@+id/fbButton" android:layout_width="51dp" android:layout_height="76dp" android:layout_marginStart="0dp" android:layout_marginTop="0dp" android:layout_marginEnd="0dp" android:layout_marginBottom="20dp" android:contentDescription="@string/mb_fb_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/instaButton" app:layout_constraintStart_toEndOf="@+id/mbLogo" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/mb_fb" tools:ignore="SpeakableTextPresentCheck" /> <ImageButton android:id="@+id/instaButton" android:layout_width="64dp" android:layout_height="68dp" android:layout_marginStart="0dp" android:layout_marginTop="0dp" android:layout_marginEnd="20dp" android:layout_marginBottom="20dp" android:contentDescription="@string/mb_insta_logo" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/fbButton" app:layout_constraintTop_toBottomOf="@+id/sevenPointsButton" app:srcCompat="@drawable/mb_insta" tools:ignore="SpeakableTextPresentCheck,ImageContrastCheck" /> </androidx.constraintlayout.widget.ConstraintLayout> </ScrollView> 这是 styles.xml: <resources> <style name="ButtonStyle" parent="Widget.AppCompat.Button"> <item name="android:background">@drawable/border</item> <!-- Reference the correct drawable name --> <item name="android:textColor">#FEBE0F</item> <!-- Text color --> <item name="android:textSize">18sp</item> <!-- Example text size --> <item name="android:padding">10dp</item> <!-- Example padding --> </style> </resources> 这是 border.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#632994" /> <!-- Background color --> <stroke android:width="5dp" android:color="#FEBE0F" /> <!-- Border color and width --> <corners android:radius="5dp" /> <!-- Rounded corners --> </shape> 在设计视图中,当我在 border.xml 中时,我看到边框,它看起来像这样: 但在我的 home_activity.xml 中它看起来像这样: 我尝试过让按钮的背景像边框一样 <Button android:id="@+id/sevenPointsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" android:text="@string/_7_points" android:background="@drawable/border" android:textColor="#FEBE0F" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/mbLogo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/servicesButton" tools:ignore="VisualLintButtonSize" /> 我什至将它放在整个视图周围,看看它是否有效,正如您从上面的图片中看到的那样。 除了将这些按钮设置为转到 HomeActivity.java 中的不同视图之外,没有其他任何东西会影响这些按钮: public class HomeActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); Button transitionButton = findViewById(R.id.activitiesButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,ActivitiesActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.healthBeautyButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,HealthBeautyActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.restaurantsButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,RestaurantsActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.retailButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,RetailActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.servicesButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,ServicesActivity.class); startActivity(intent); }); transitionButton = findViewById(R.id.sevenPointsButton); transitionButton.setOnClickListener(v -> { Intent intent = new Intent(HomeActivity.this,SevenPointsActivity.class); startActivity(intent); }); } } 尝试使用不同的按钮类型,因为这些按钮很难自定义 <androidx.appcompat.widget.AppCompatButton android:id="@+id/sevenPointsButton" android:layout_width="0dp" android:layout_height="100dp" android:layout_marginStart="20dp" android:layout_marginEnd="20dp" android:text="@string/_7_points" android:background="@drawable/border" android:textColor="#FEBE0F" app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" app:autoSizeMaxTextSize="30sp" app:autoSizeStepGranularity="1sp" app:layout_constraintBottom_toTopOf="@+id/mbLogo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/servicesButton" tools:ignore="VisualLintButtonSize" /> 试试这个

回答 1 投票 0

如何在 SwiftUI 中检测按下按钮并采取行动

我想在开始按下按钮时执行一个动作,然后在停止按下按钮时执行一个动作。我一直在寻找一个简单的解决方案,但遇到了更复杂的配置。一种选择...

回答 3 投票 0

需要 CSS3 按钮样式

好的,所以我被赋予了重新创建此按钮的任务 https://s27.postimg.org/7e1upkf4j/BUTTONS.png 使用 HTML 的这一部分 首页 好的,所以我被赋予了重新创建此按钮的任务 https://s27.postimg.org/7e1upkf4j/BUTTONS.png 使用 HTML 的这一部分 <a href="#"> Home <i class="material-icons ico-style">home</i> </a> 我需要帮助,我对渐变以及部分是否应该是框阴影或插入边框等迷失了方向。请你解释一下答案 这里是渐变部分的建议。您需要自己添加图标。 a { position: relative; display: inline-block; width: 120px; height: 50px; line-height: 50px; text-align: center; border-radius: 25px; border: 1px solid lightgray; background: linear-gradient(#999,#fff); text-decoration: none; } a::before { content: ''; position: absolute; left: 9px; top: 9px; width: 100px; height: 30px; border-radius: 15px; border: 1px solid gray; background: white; } a span { position: relative; } <a href="#"> <span>Home <i class="material-icons ico-style"></i></span> </a> 您可以使用此工具来设计按钮样式按钮生成器

回答 2 投票 0

单击时按钮透明度和边框颜色变化的问题

我的 HTML 代码中有一个按钮,我使用 CSS 对其进行了样式设置,使其具有绿色背景、白色文本和橙色边框。这是 HTML 和 CSS 代码: .index_button_left.btn_custom { 背景-

回答 1 投票 0

如果到达最后一页则隐藏按钮

我尝试在网络上搜索有关如何执行此操作的解决方案,更不用说来自其他开发人员的 youtube,但似乎找不到我正在寻找的答案。 我正在尝试创建一个 ButtonView,其中...

回答 1 投票 0

HTML 上的一个按钮有两个操作

我用 HTML 制作了一个按钮,当我单击它时,第一个操作起作用,但第二个操作不起作用。我想要相同的按钮在第二次单击后用新文本替换文本。 ...

回答 1 投票 0

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.