How to stretch layout to edges [closed] - android

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
How can I stretch the black to the edges? Id like to do that then put an overflow to make it a bit transparent :)

Change the dimensions in dimens.xml. By default, there is a border of 16dp around everything, so change that to 0dp. If you continue to want a border around the ListView, you can manually add the padding for that specific object by defining it in the XML layout.

Have you tried match_parent? You could also change the margins.

Related

How to know the display's size of an aplicattion in android? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm developing an Android application, but I'm a noob using it.
I already know that I can make use of the .XML file to design the application's interface, but, by large amount of views that I have to configure inside of the .XML file, I decided to add the views programmatically, and all it's ok at this point.
My question is, can I know, NOT the size of the devices display, but the size of the area where the application is displayed?
If such thing it's not possible at all, at least can somebody explain me how can I do to make my application visible at all the screen (e.g. As happens when we open Adobe Reader for Android, covering even the notification bar, where the time is appreciated.)?
I've made use of the setFillViewPort() property for the ScrollView that contains a LinearLayout, and it holds inside all that you can see, but it does not work for covering all the display (as you can see, there's a blank space at the end).
Thank you very much.
Here's the current inteface of the application.
Link
For hiding notification Bar you have to add this code in AndroidManifest.xml File
<application
...
android:theme="#android:style/Theme.Holo.NoActionBar.Fullscreen" >
...
</application>
you can get more info about this from, https://developer.android.com/training/system-ui/status.html
Use this code.. this code give me the size of mobile screen in pixel.
// Get Display size for automatic animation
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;

Android: creating a layout that goes beyond screen width [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need to create a layout like the image below. The blue rectangle in the image represents the screen.
Creating a layout with 4 images is easy, the simpelest way is probably with vertical and horizontal LinearLayouts.
But i don't have a clue how i can go beyond the screenwidth for panning reasons
It's probably not the best solution but since you would like to design outside the screen borders one option would be to use a RelativeLayout for instance and then assign negative margins for the left-side pictures.

Adding Top/Bottom border to TextView programmatically [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I have a TextView and I need to put a black border on the top of it.
The view is created in java, so I can't use the classic XML divider trick.
Many answers here suggest to put a black line as a background. I tried, but I found out that zooming in the view results in the line overflowing its content (in my application the views' textSizes are constantly changed by pinch zooming, so I can't know a definite width in advance.
So, my question is: is there a simple way to add a top border to a TextView which adapts to its size and which can be created from java without using XML?
Try Compound Drawables. They can be set by XML or in Code.
Use nine patch images for the Drawables or even Shape drawables and they should scale ok with the TextView.

Linear Layout Or Relative Layout? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
someone said people must use relative layout when make android app. Because if use linear layout, app's screen doesn't adjust device screen. (I mean width and height doesn't adjust). But if I use relative layout, it's make me annoyed when I set image. Is opinion which I hear right ?
In my view i would prefer RelativeLayout as parent.
And i go for LinearLayout for all the inner layouts where i can use
android:orientation and android:height as match_parent/fill_parent that will fill only the space available with in LinearLayout.
I never prefer to use dp values for android:height and android:width
I'll go with Relative Layout as we can set different views easily in this layout.
Both have it's own pros and cons. Both can adjust without any problem to device screen. What really matter are the views that you will put inside of them (children) and how they will be organized.
In addition to that, you may want to modify the gravity, margin, padding, alignment or any other to achieve a desired result.

(android) I want to my layout available for large screens too [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I want to my layout available for large screens too.On large screens background image grow up but my buttons remains on the left. I try to set margin but it does not work .
My button xml
<Button
android:id="#+id/ex"
android:layout_width="149dp"
android:layout_height="183dp"
android:layout_x="165dp"
android:layout_y="262dp"
android:layout_marginLeft="5dp"/>
what can ı do
Use a parent View other than AbsoluteLayout, remove Layout_x & Layout_y and set the Gravity of the parent View to Center
dude check Supporting different screen sizes. do some google on writing layouts for different screen sizes you will get plenty of help.

Categories

Resources