PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label background-color. Show all posts
Showing posts with label background-color. Show all posts

Wednesday, September 14, 2022

[FIXED] How to change NavBar colour of MasterMainPage in Xamarin

 September 14, 2022     background-color, cross-platform, navbar, xamarin.forms     No comments   

Issue

I'm building a Xamarin cross-platform App!

The problem is I want to change the colour of NavigationBar of MainPage which is MasterPage with a drawer menu in it.

I tried with this code to change the colour but an extra bar appears on NavBar which I don't Want to.

App.xaml.cs:

  MainPage = new NavigationPage(new MainPage())

        {
            BarBackgroundColor = Color.FromHex("#00477f"),
            BarTextColor = Color.White,
        };

ScreenShots: These Screenshots shows what the problem I'm facing!

https://i.stack.imgur.com/fbXie.png

https://i.stack.imgur.com/vuA1A.png


Solution

Here, when you assign App.xaml's MainPage, a NavigationPage, it shows it's own NavigationBar. Under the hood, your MasterDetailPage also shows the NavigationBar. Thus, you are viewing two NavigationBars.

Go to your MainPage.xaml.cs backend page and in the Constructor, write the line:

NavigationPage.SetHasNavigationBar(this, false);

Thus, your MainPage.xaml.cs should look like :

public MainPage()
{
    NavigationPage.SetHasNavigationBar(this, false);
    InitializeComponent();
    ......
}

This will hide the NavigationBar of MasterDetailPage.



Answered By - MilanG
Answer Checked By - Willingham (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, July 18, 2022

[FIXED] How to transition between colours using jQuery click()

 July 18, 2022     background-color, css, document-body, javascript, jquery     No comments   

Issue

im looking to transition between colours when a user selects different radio button values. I already have a 'working' example at the moment with just the immediate changing of the body's background colour, however i tried to use the fadeOut() and fadeTo() methods, but to no avail.

here's what i have thus far, if someone could point me to where i should be altering and which method to utilise.

many thanks in advance!

colourChange.js

$(document).ready(function () {

  $("#goodRad").click(function () {

        $("body").css('background-color', '#90EE90');//LightGreen
        console.log("make body green!");
  });

  $("#okRad").click(function () {

        $("body").css('background-color', '#FFA07A');//LightSalmon
        console.log("make body amber!");
  });

  $("#badRad").click(function () {

        $("body").css('background-color', '#F08080');//LightCoral
        console.log("make body red!");
  });
});

Solution

You can use css to transition background-color. I also reworked your jquery to a little, but all you need to do is add the CSS from this answer.

$('input').on('change',function() {
  $('body').css('background-color',$(this).attr('data-color'));
})
body {
  transition: background-color .5s;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input name="color" data-color="#90EE90" type="radio"><input name="color" data-color="#FFA07A" type="radio"><input name="color" data-color="#F08080" type="radio">



Answered By - Michael Coker
Answer Checked By - Pedro (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

[FIXED] why does background-color property fills the entire screen even body have 0 height?

 July 18, 2022     background-color, css, document-body, html, inheritance     No comments   

Issue

Can anyone explain why the background color is filling the entire screen even when body is having zero height?

.bgcolor { 
  background-color : red;
  height:0;
}
<body class="bgcolor"></body>


Solution

body tag is always taking the whole document's body, so if you want to give background with limited height then put one DIV inside the body tag and then give specific height, then it will work fine.

so for the solution, please give background color to HTML div as well.

html {
  background-color: #ffffff;
}


Answered By - Gaurang Sondagar
Answer Checked By - Mary Flores (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing