Questions tagged [button]

Buttons are simple elements in graphical user interfaces that take mouse clicks or finger taps (on touch devices) as input.

In computing, a button (sometimes known as a command button or push button) is a user interface element that provides the user a simple way to trigger an event, like executing a query on a search engine or to interact with dialog boxes to confirm an action.

When asking questions specific to a particular framework or language, it's best to use the appropriate tag instead (if it's available). For example, the HTML <button> element should be tagged with , iOS buttons should be tagged with , and Java Swing buttons should be tagged with .

40417 questions
6
votes
1 answer

How to disable Go button on iPhone keyboard

Can any one please let me know how to disable the 'Go' button on keyboard? The purpose is: when the text field is empty Go button has to be disable (gray color) and when type some thing the Go button become active and color blue. (Same as Apple…
Chinthaka
  • 966
  • 1
  • 13
  • 42
6
votes
3 answers

Maximize size of Android button text

I had multiple buttons in a LinearLayout horizontally. On a larger device all the button text fit on one line at 20sp text size. However, on a smaller device at 20sp text size, the text of the buttons goes to two lines. How can I tell it to make the…
Amandeep Grewal
  • 1,801
  • 3
  • 19
  • 30
6
votes
2 answers

How do you check whether a button is enabled or not in Android?

In Android I can set a button to be enabled or disabled by doing the following: button.setEnabled(true); or button.setEnabled(false); How do I check whether the button enabled state is true or false?
atbebtg
  • 4,023
  • 9
  • 37
  • 49
6
votes
3 answers

Material UI IconButton onClick to increment or decrement values

I'm trying to implement the onClick() of a Material UI IconButton, that will decrement or increment the Calories value of each element in the table, like this. My code is based on the Table React component page code. In this case, if I click in the…
Grandtour
  • 1,127
  • 1
  • 11
  • 28
6
votes
2 answers

How can I underline a single character in the Content of a Button in WPF?

I have a number of buttons in my WPF window and I would like to have certain characters in the button contents underlined. I have tried using the "_" like "My_Content" to underline the C, however this does not appear until the user hits the Alt…
MtnDew
  • 77
  • 1
  • 5
6
votes
2 answers

How to make a share button in android - Kotlin

How can I make a working share button so it's possible to share certain quotes (It's share's the text from the textview over) I found the following code online: override fun onCreate(savedInstanceState: Bundle?) { …
Renza Polza
  • 87
  • 1
  • 8
6
votes
2 answers

Android App Exits on Press on Back Button Instead of Navigating to Previous Screen - Flutter

This is main.dart void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, ]); return…
Ruban Thilak
  • 157
  • 1
  • 7
6
votes
1 answer

How to change a button image when the button is pressed in swiftui

I would like to change the image name when the button is pressed. This is my structure so far: struct ContentView: View { @State var matrix = [Int] var body: some View { VStack { Text("Test") …
Fred Cox
  • 61
  • 4
6
votes
2 answers

HTML5 dialog element close button not working properly

I'm looking at this question post, and I'm having trouble applying it to work in my code. It's confusing me because I'm doing the exact same thing for the save button as I am the cancel button (at least, the part about it closing) and nothing…
Threshold19
  • 107
  • 7
6
votes
1 answer

How to change Cursor Icon upon button click on React

How do I change my cursor to be an icon when I click a button and then place that icon down on the second click, and become a regular cursor again? I'm working in React. All I have is that when I button is clicked, the global boolean clicked is…
user12677345
  • 61
  • 1
  • 1
  • 3
6
votes
4 answers

Buttons broken using new Input System

I've got a problem that is seemingly impossible to debug. My project originally started using 2019.2 and upgraded to 2019.3 without any problems. I then installed the preview package for the new input system. This "disabled" all the buttons in that…
JudasMoses
  • 378
  • 4
  • 22
6
votes
2 answers

SwiftUI destructive Button style

is there a way to get a destructive Button style in SwiftUI? I know I can do this for a ContextMenu, but I did not find a way for "normal" Button. Cheers
gurehbgui
  • 14,236
  • 32
  • 106
  • 178
6
votes
1 answer

SwiftUI - Two Separate Buttons Acting As One

Xcode 11.3 (11C29). macOS 10.15.2. In the SwiftUI View below there are two buttons. One prints "OK" and the other prints "Cancel". However, regardless of whichever button is pressed, both print statements are executed. Why is that? (I assume…
Vince O'Sullivan
  • 2,611
  • 32
  • 45
6
votes
3 answers

How to create rectangle icon button without label in flutter?

we can create the icon button with FlatButton.icon() but it requires label parameter. we can also use IconButton() but it makes a circular icon button. how to make a rectangle icon button like FlatButton() but with just icon in flutter?
rahul Kushwaha
  • 2,395
  • 7
  • 32
  • 64
6
votes
3 answers

Is it possible to handle events generated by volume up/down completely in Flutter?

Is it possible to intercept events generated by hardware buttons completely in Flutter? For example if the app is active and volume up/down button is pressed, is it possible to intercept that event in the app, handle it in the app specific way and…
hicnar
  • 163
  • 3
  • 9