Android studio entire screen width with width of the action bar
up vote
0
down vote
favorite
I want to put n images from edge to edge with this code
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
height = displayMetrics.heightPixels;
width = displayMetrics.widthPixels;
width_imagine =(int) (width/n);
LinearLayout.LayoutParams layoutParams = new
LinearLayout.LayoutParams(width_imagine, 100);
imagine.setLayoutParams(layoutParams);
image without action bar
Because the action bar is there i can t get a precise width.
enter image description here
How can i get width of the entire screen?
java
add a comment |
up vote
0
down vote
favorite
I want to put n images from edge to edge with this code
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
height = displayMetrics.heightPixels;
width = displayMetrics.widthPixels;
width_imagine =(int) (width/n);
LinearLayout.LayoutParams layoutParams = new
LinearLayout.LayoutParams(width_imagine, 100);
imagine.setLayoutParams(layoutParams);
image without action bar
Because the action bar is there i can t get a precise width.
enter image description here
How can i get width of the entire screen?
java
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to put n images from edge to edge with this code
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
height = displayMetrics.heightPixels;
width = displayMetrics.widthPixels;
width_imagine =(int) (width/n);
LinearLayout.LayoutParams layoutParams = new
LinearLayout.LayoutParams(width_imagine, 100);
imagine.setLayoutParams(layoutParams);
image without action bar
Because the action bar is there i can t get a precise width.
enter image description here
How can i get width of the entire screen?
java
I want to put n images from edge to edge with this code
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
height = displayMetrics.heightPixels;
width = displayMetrics.widthPixels;
width_imagine =(int) (width/n);
LinearLayout.LayoutParams layoutParams = new
LinearLayout.LayoutParams(width_imagine, 100);
imagine.setLayoutParams(layoutParams);
image without action bar
Because the action bar is there i can t get a precise width.
enter image description here
How can i get width of the entire screen?
java
java
asked Nov 7 at 20:34
Lucian Gabriel
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53197396%2fandroid-studio-entire-screen-width-with-width-of-the-action-bar%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown