Asked  7 Months ago    Answers:  5   Viewed   29 times

I have a standard html page so:

<html>
<head>..
.
..
and so on

and i have a php script linked to that html page with:

if blablabla {

change background color;
}

does anyone know how to change the background color of my page if the conditions in the if statement are met?

I hope i made this clear, if not, please say which bit is unclear.

Thanks for any help in advance

 Answers

87

put your <body> tag inside the if else

if blablabla {

 echo '<body style="background-color:white">';
}
else {
 echo '<body style="background-color:orange">';
}
Wednesday, March 31, 2021
 
The_Perfect_Username
answered 7 Months ago
86

You should point to your vendor/autoload.php at Settings | PHP | PHPUnit when using PHPUnit via Composer.

This blog post has all the details (with pictures) to successfully configure IDE for such scenario: http://confluence.jetbrains.com/display/PhpStorm/PHPUnit+Installation+via+Composer+in+PhpStorm

Related usability ticket: http://youtrack.jetbrains.com/issue/WI-18388

P.S. The WI-18388 ticket is already fixed in v8.0

Wednesday, March 31, 2021
 
ojrac
answered 7 Months ago
79

On Mac OS X environment variables available in Terminal and for the normal applications can be different, check the related question for the solution how to make them similar.

Note that this solution will not work on Mountain Lion (10.8).

Saturday, May 29, 2021
 
Nate
answered 5 Months ago
80

Probably the only way to accomplish that is to draw the items yourself.

Set the DrawMode to OwnerDrawFixed

and code something like this on the DrawItem event:

private void listBox_DrawItem(object sender, DrawItemEventArgs e)
{
    e.DrawBackground();
    Graphics g = e.Graphics;

    g.FillRectangle(new SolidBrush(Color.Silver), e.Bounds);

    // Print text

    e.DrawFocusRectangle();
}

Second option would be using a ListView, although they have an other way of implementations (not really data bound, but more flexible in way of columns)

Wednesday, June 2, 2021
 
Markol
answered 5 Months ago
57

You will need to set the backgroundDrawable for the TextView. I've only done my state lists in XML and it would be something like this:

<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <color android:color="#00ff00" />
    </item>
    <!-- And so on -->
</selector>

From what I understand, from the documentation if you want to do the state list in Java code you will need to use the StateListDrawable

Thursday, August 19, 2021
 
Mark Comix
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :