How to change cardview background color Programmatically in Kotlin - kotlin

I try to do this:
cardview.cardBackgroundColor(Color)
but I have this message: The function 'invoke()' is not found.
Any idea?

Did you tried using
cardView.setCardBackgroundColor(Color.RED);
or create any color from a reference like below
val color = ContextCompat.getColor(this#SplashActivity, R.color.colorPrimary)
cardView.setCardBackgroundColor(color);

I found it, I forgot the set
cardview.setCardBackgroundColor(Color)
Everything works fine now, the background of my cardview change.

Related

How can I charge number line of dropdownmenu using #shoutem/ui?

I try to used #shoutem/ui! In my project, I define 1 Component with header is NavigationBar of #shoutem/ui, in NavigationBar I try define rightComponent is an DropDownMenu, but when long content, navigation bar will made 2 line and I don't want that way! I'm still want it pingleline!
That's what I'm facing:
Please Help.
It seems that this PR https://github.com/shoutem/ui/pull/216/files solves it, so please check if you are using the latest version of #shoutem/ui.

How to set a Image Button's image xcode aplescript OBJC

I am trying to change an Image Button's image object with this code using applescript.
I have tried this:
property theButton : missing Value
on button_(sender)
set newImage to "example.png"
changeImage(newImage)
end button_
on changeImage(newImage)
set theImage to current application's NSImage's imageNamed_(newImage)
theButton's setImage_(theImage)
end changeImage
First clarify a few things:
Is the button connected properly? Do you want to change the image on click or before? That's what your code says. If you want to change image before do it in IB or in awakeFromNib method.
Is the buttons action linked properly? Either in IB if your on XCode or pure applescript objc:
theButton's setTarget:me
theButton's setAction:"changeImage:"
If linked you may use a log message to see if it works:
log "works"
This should bring you forward - otherwise please post more code
on changeSomeImage_(newImage, targetObjectOutlet, newText, targetLableOutlet)
set newImage1 to current application's NSImage's imageNamed_(newImage)
targetObjectOutlet's setImage_(newImage1)
targetLableOutlet's setStringValue_(newText)
end changeSomeImage_

Template 10 :Hamburger Panel color not changing

I am creating a uwp app and when i set my xaml code to this
<Controls:HamburgerMenu x:Name="MyHamburgerMenu" HamburgerBackground="#FFD13438"
HamburgerForeground="White"
NavAreaBackground="# FF2B2B2B"
NavButtonBackground="#FFD13438"
SecondarySeparator="White"
NavButtonForeground="White"
LostFocus="MyHamburgerMenu_LostFocus"
DisplayMode="CompactOverlay"
>
Its not changing the color of the Hamburger Panel I have tried all colors.Its still shows the default colors only.
Also even when i change the display mode it still pushes the Title Page.
I dont whats causing the issue.My Template 10 version is v1.1.10.
The issue
To set the background color of the hamburger panel, you have to use the NavAreaBackground dependency property as you did. It should work fine. The problem is the space character between '#' and the hexadecimal value 'FF2B2B2B' in your code. Just remove the space character and it will work : NavAreaBackground="#FF2B2B2B"
In your Shell.xaml.cs file just comment this line HamburgerMenu.RefreshStyles(_settings.AppTheme, true);
It should work.

three.js - How to change background using WebGLDeferredRenderer

Can't seem to find how to change a background color when using WebGLDeferredRenderer.
renderer.clearColor = 0xff0000; doesn't work.
Thanks
WebGLDeferredRenderer is just a wrapper for WebGLRenderer, you can access the functions of WebGLRenderer via WebGLDeferredRenderer.renderer e.g.:
renderer.renderer.setClearColor(clearColor);

FilteringSelect text alignment

Using Dojo 1.6.1
I have a FilteringSelect that looks like:
When an address is selected, it looks like:
What I'd really like to see instead is:
Any ideas on how this could be accomplished?
When you select a value in a Filtering select, the caret position is at the end of the text, so it's not CSS that will help you there.
You have to move the cursor to the beginning of the text.
I see no other option than javascript here.
If you look at the template of dijit.form.FilteringSelect, you will see that the input node is bound to the property "focusNode" of the widget. So you could use that to move the caret, like this :
dijit.byId('your_filteringSelect_id').onChange = function(evt) {
this.focusNode.setSelectionRange(0,0);
}
This appears to be an IE & FF issue see this listed bug:
http://bugs.dojotoolkit.org/ticket/8298
and also this test case (issue seen in IE7-9):
http://jsfiddle.net/snover/96Ud8/
The work around suggested is to set the function _setCaretPos to do notthing e.g
dijit.byId('your_filteringSelect_id')._setCaretPos = function() {};
.setSelectionRange doesn't work at IE
Use dijit.selectInputText(widget.focusNode,0,0); instead