Change the background color of a pop-up dialog

To expand on @DaneWhite’s answer, you don’t have to rely on the built-in themes. You can easily supply your own style: <style name=”MyDialogTheme” parent=”Theme.AppCompat.Light.Dialog.Alert”> <item name=”android:background”>@color/myColor</item> </style> and then apply it in the Builder constructor: Java: AlertDialog alertDialog = new AlertDialog.Builder(getContext(), R.style.MyDialogTheme) … .create(); Kotlin: var alertDialog = AlertDialog.Builder(context, R.style.MyDialogTheme) … .create() This should work … Read more

How to set text color of a TextView programmatically? [duplicate]

Use,.. Color.parseColor(“#bdbdbd”); like, mTextView.setTextColor(Color.parseColor(“#bdbdbd”)); Or if you have defined color code in resource’s color.xml file than (From API >= 23) mTextView.setTextColor(ContextCompat.getColor(context, R.color.<name_of_color>)); (For API < 23) mTextView.setTextColor(getResources().getColor(R.color.<name_of_color>));

How to customize UISwitch button in iphone?

You can not modify UISwitch control unless and until you write your own control, But best way so far, you can used UISegmentControl and handle event on it to switch the on.png and off.png images. UISegmentedControl* switchView=[[UISegmentedControl alloc] initWithItems:[[[NSMutableArray alloc] initWithObjects:@”On”,@”Off”,nil] autorelease]]; [switchView setFrame:CGRectMake(20,365,140,28)]; switchView.selectedSegmentIndex=0; switchView.segmentedControlStyle=UISegmentedControlStyleBar; [switchView setImage:[UIImage imageNamed:@”onSelected.png”] forSegmentAtIndex:0]; [switchView setImage:[UIImage imageNamed:@”off.png”] forSegmentAtIndex:1]; [switchView … Read more

Is it possible to change only the alpha of a rgba background colour on hover?

This is now possible with custom properties: .brown { –rgb: 118, 76, 41; } .green { –rgb: 51, 91, 11; } a { display: block; position: relative; } div { position: absolute; bottom: 0; background-color: rgba(var(–rgb), 0.8); } a:hover div { background-color: rgba(var(–rgb), 1); } To understand how this works, see How do I apply … Read more

Background with 2 colors in JavaFX?

I used a simple layer of background colors to produce a red highlight (similar to Stefan’ suggested solution). /** * file: table.css * Place in same directory as TableViewPropertyEditorWithCSS.java. * Have your build system copy this file to your build output directory. **/ .highlighted-cell { -fx-text-fill: -fx-text-inner-color; -fx-background-color: firebrick, gainsboro; -fx-background-insets: 0, 2 0 0 … Read more

Is this possible to create 2-axis 4 color gradient in css (bilinear gradient)?

mask combined with linear-gradient can do it: .box { height: 200px; width: 300px; background: linear-gradient(to right, rgb(238, 252, 83), rgb(120, 239, 197)) } .box::before { content: “”; display: block; height: 100%; background: linear-gradient(to right, rgb(253, 67, 205), rgb(74, 68, 215)); -webkit-mask: linear-gradient(to bottom,#0000, #000); mask: linear-gradient(to bottom,#0000, #000); } <div class=”box”></div> Another kind of coloration: … Read more

How to use JavaScript to change div backgroundColor

var div = document.getElementById( ‘div_id’ ); div.onmouseover = function() { this.style.backgroundColor=”green”; var h2s = this.getElementsByTagName( ‘h2’ ); h2s[0].style.backgroundColor=”blue”; }; div.onmouseout = function() { this.style.backgroundColor=”transparent”; var h2s = this.getElementsByTagName( ‘h2’ ); h2s[0].style.backgroundColor=”transparent”; };

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)