application portrait to landscape screen issue

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

application portrait to landscape screen issue

Postby vnareshprasad » Sat Nov 07, 2009 9:42 pm

Im a new bie of Android developement .In my application i use screens involving buttons and boxes and edittext . At first used a Absolute layout and no problem with Portrait view and while testing in Landscape the screen does not displays all items Only upto what the screen fits in. So , i changed the screens layout to Relative and Linear Layouts. But still i experience the same problem . And i doubt it on usuage of
Android Manifest file's
android:configChanges="orientation|keyboardHidden"

Can you help in this issue .. Searched in google but not able to find a soln to my prob but similar issues are discussed like "fixing up portrait or landscape","Game appln need portrait",etc.. . If the similar thread is already over . Pls let me
know it .
Thanks in Advance...
vnareshprasad
Freshman
Freshman
 
Posts: 5
Joined: Sat Nov 07, 2009 9:00 pm
Location: Tamil Nadu

Top

Postby rvaul » Sat Nov 07, 2009 11:03 pm

I'm a complete noob myself and can't help much, but from what I think you're getting at...

As for the layout problem, try putting everything back into <RelativeLayout>, with 'wrap_content" as the values, that should make everything as "small" as possible and make it all fit into the screen.
Also, when using <Relative> with more than one button, or text box, or anything of the sort, make sure all of your stuff is in it's own layout.

Hope I helped some.
rvaul
Junior Developer
Junior Developer
 
Posts: 18
Joined: Wed Nov 04, 2009 11:25 am

Postby vnareshprasad » Sun Nov 08, 2009 4:04 pm

Thanks rvaul , But
FYI, Im now using Relative for some screens and linear layout for some screens only and all items (buttons, text items) are inside the layout only with wrap content only.
This didnt resolved my problem.
vnareshprasad
Freshman
Freshman
 
Posts: 5
Joined: Sat Nov 07, 2009 9:00 pm
Location: Tamil Nadu

Postby I_Artist » Sun Nov 08, 2009 5:02 pm

Hi guys,

maybe it would help you to know that you can actually create 3 different kinds of layout files in Android.

You are used to the layouts that are in the res/layout folder, these are used in both portrait (vertical) and landscape (horizontal) modes.

There is also a res/layout-land folder, layouts in that folder will be used when the phone is in landscape mode. And a res/layout-port folder, layouts here will be used when the phone is in portrait mode.

For example let's say you have 2 activities. The first activity's layout works fine in both mode, but the second one does not show up well in landscape mode. You may want to define specific layouts for the second activity.

/res/layout/act1.xml
/res/layout-port/act2.xml
/res/layout-land/act2.xml

As you can see the portrait and landscape layouts for act2 have the same name, the system will choose the correct one as needed.

Cheers!
The I_Artist

follow me on Twitter: @I_Artist
follow Android Development on Twitter: #androiddev

Show the world that you are an #androiddev, wear the badge http://www.twibbon.com/join/androiddev
User avatar
I_Artist
Developer
Developer
 
Posts: 33
Joined: Fri Oct 16, 2009 3:49 am
Location: St-Eustache, Quebec

Postby rvaul » Sun Nov 08, 2009 11:04 pm

Dammit. Where was that info last time I was trying to make something? ;)


Thank you I_Artist
rvaul
Junior Developer
Junior Developer
 
Posts: 18
Joined: Wed Nov 04, 2009 11:25 am

Re: application portrait to landscape screen issue

Postby vnareshprasad » Mon Nov 09, 2009 6:11 am

Check this out .

vnareshprasad wrote:In my application i use screens involving buttons and boxes and edittext . At first used a Absolute layout and no problem with Portrait view and while testing in Landscape the screen does not displays all items Only upto what the screen fits in. So , i changed the screens layout to Relative and Linear Layouts. But still i experience the same problem .


Make something right now :D
Last edited by vnareshprasad on Mon Nov 09, 2009 7:49 pm, edited 1 time in total.
vnareshprasad
Freshman
Freshman
 
Posts: 5
Joined: Sat Nov 07, 2009 9:00 pm
Location: Tamil Nadu

Top

Postby vnareshprasad » Mon Nov 09, 2009 6:15 am

Thank you I_Artist,
Think this Will help me out resolving the problem and post if when i resolved it .
vnareshprasad
Freshman
Freshman
 
Posts: 5
Joined: Sat Nov 07, 2009 9:00 pm
Location: Tamil Nadu

Re: application portrait to landscape screen issue

Postby rvaul » Mon Nov 09, 2009 12:08 pm

vnareshprasad wrote:If cant read a document written in this form . Check your eyes or english .



*snicker*

Uumm...Okay...

Calm down. Aren't most of us here because we needed a little help somewhere?

Anyway...
rvaul
Junior Developer
Junior Developer
 
Posts: 18
Joined: Wed Nov 04, 2009 11:25 am

Postby Skeniver » Mon Nov 09, 2009 4:07 pm

Thanks I_Artist!
Follow me on twitter -> http://twitter.com/Skeniver
Apps & blog -> http://www.formidableapps.co.uk
User avatar
Skeniver
Senior Developer
Senior Developer
 
Posts: 106
Joined: Tue Feb 03, 2009 3:51 pm
Location: Canterbury, UK

Postby I_Artist » Mon Nov 09, 2009 4:37 pm

You're welcome guys. Glad to see that you read the posts and figured it out. The sign of true programmers...

vnareshprasad, please mark the thread as solved, thanks :)

Cheers!
The I_Artist

follow me on Twitter: @I_Artist
follow Android Development on Twitter: #androiddev

Show the world that you are an #androiddev, wear the badge http://www.twibbon.com/join/androiddev
User avatar
I_Artist
Developer
Developer
 
Posts: 33
Joined: Fri Oct 16, 2009 3:49 am
Location: St-Eustache, Quebec

Postby vnareshprasad » Mon Nov 09, 2009 6:31 pm

Thanks I_Artist ,Your post was helpful for me . And also made use of <ScrollView> enclosing the entire layout for lengthier screens .

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="fill_parent">
....
....
</LinearLayout>
</ScrollView>

This gave a scroll bar to scroll down long screens when converted to Landscape mode.
The Problem is now resolved. Thank you all :) ...
vnareshprasad
Freshman
Freshman
 
Posts: 5
Joined: Sat Nov 07, 2009 9:00 pm
Location: Tamil Nadu

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 3 guests