Working on a kind of RaspPi Android Things mirror with a vertical screen with resolution 1080p, getDefaultDisplay() method show me WIDTH: 416 HEIGHT: 656 info.
Is there any way to change the output resolution?
Thanks in advance!
UPDATE 1:
The above happened using display_rotate=1. Without the rotation modification the app give me WIDTH: 1824 HEIGHT: 984 values.
Related
I'm using the new gatsby image plugin, and StaticImage. I have got a few images on the website, all works perfect normally beside one that only has the black background
(source of black, change the bg color attribute to red for example change the view to red)
The<picture> tag has 0X0 pixels
Another weird thing is the auto-created div container has a max-width of 47px, though the image is bigger than that (in all rest cases the max-width actually corresponds to the image dimensions)
relevant code
// js
<div className="advertising">
<StaticImage
className="advertising-img"
src="../images/advertising.png"
alt="advertising"
/>
//scss
.advertising {
position: relative;
margin: 123px 162px 150px 536px;
.advertising-img {
width: 260px;
height: 230px;
position: absolute;
left: -460px;
top: -15px;
}
page lookout (for understanding the CSS a little bit and show another picture that working..)
any help will be appreciated, thanks in advance! :)
edit
live site - https://catsh-landing-page.netlify.app/
The request to advertising image is blocked by the browser, as you can see by opening the dev tools.
In addition, the fact that is working on my mobile phone (screenshot below):
Makes me think that the image is blocked by the browser itself or by some extensions (AdBlock, etc) because of the name to avoid advertisers or publicity by default.
Try changing the name of the image or try disabling the extensions.
I have a code for View with Image in swiftUI, I wonder if the frame() function will produces different size for each devices(like iPhone 8, Xs, Xs+, etc)
struct CircleImage : View {
var body: some View {
Image("jorge")
.resizable()
.frame(width: 100, height: 100)
.clipShape(Circle())
.overlay(
Circle().stroke(Color.white, lineWidth: 4))
.shadow(radius: 10)
}
}
I have Xcode 11 with beta of course, but I don't have catalina since I have to do my work with Mojave and Catalina doesn't support it. So I can't find any clues with SwiftUI Preview.
I also tried to see above code with multiple simulators(with 8 and Xs+) and I saw that images seems have same size but I'm not sure for it.
And If the sizes are same, what is the standard size of screen? and if not, how can I find each screen's standards?
I'm not sure I understand your question, but I'll do my best to answer. When you specify a frame(width: 100, height: 100), SwiftUI will make it 100x100 points. No matter which device. If you would like to adapt to the available space of a device, check the example I posted in this other question: https://stackoverflow.com/a/56853211/7786555
Additionally, here's the documentation to get the screen size for your current device:
The bounding rectangle of the screen, measured in points:
https://developer.apple.com/documentation/uikit/uiscreen/1617838-bounds
The bounding rectangle of the physical screen, measured in pixels.
https://developer.apple.com/documentation/uikit/uiscreen/1617810-nativebounds
I'm trying to make modifications to layout of TrackMix app as shown in Creating Your First Mac App.
I wanted the "Mute" button to take 160px or less. The equivalent CSS rule would be width: 100%; max-width: 160px; margin: 0 auto;. I'm not sure how to achieve this in Interface Builder or in code. Here's what I have so far
While 71 pixels is indeed less than 160px. Is there a way to make the button take all available space?
This is working for me:
I have also added a center constraint + leading and tailing edge constraint to parent container. I've set the leading/tailing constraint priority to 250 because they need to be breakable.
I am not very experienced with image sprites so here is the question..
I made an image sprite on the web; this is the code:
.sprite-slidebutton {
background-position: 0 0;
width: 70px;
height: 63px;
}
.sprite-slidecross {
background-position: 0 -113px;
width: 70px;
height: 63px;
}
The image I got, I downloaded to my page and I called the .png wherever wanted it. It does appear! And the sprite is working, the image is switching like i want it to..
But the PNG is not showing a transparent background :S also the image is not in the middle, I only see half of the both images.. where and how to adjust?
To see it live:
solved
If i had to guess i would say there is a problem with the alpha values in the image. Download gimp and see what they are.
the png probably has a white background, instead of a transparent background. that's something you will need to edit in photoshop, gimp or similar.
as far as only seeing half the image it might be due to the element you are assigning the class to. if its an inline element like <a> or <span>. try adding "display:block;" inside the sprite-slidebutton class.
I am puzzled by what I am doing. First take a look at my tiny snippet:
HTML:
<div class="image_container"></div>
CSS:
.image_container {
background-image: url("images/wall.jpg");
height: 120px;
width: 100%;
}
What I am using above was to have a container with an image as a background that will take the entire width of the user's screen since I am using width: 100%. But on my 13 inch Mac it looks that way but when I go to a much larger screen the image shows partially but doesn't take 100% of the screen. Why is it that despite using width 100% it still won't take the entire width?
I tried to see if I can use background-repeat: repeat-x but that simply repeats the image and it looks terrible. What else can I do or is there another approach?
Because you set the width for the div, not the image. Try background-size: cover;
Oh...and container should actually be class.