![]() ![]() When developing your UI, you need to consider how your images will appear on screens with different pixel densities. Success! Optimizing for Different Android Screen Densities In this example, we’ll use the following layout: ĭouble-check your app displays properly in both portrait and landscape modes by running it in the Android Emulator and toggling between the different orientations. You are now ready to design a second layout specifically for landscape mode. ![]() You now have two activity_main.xml layout files, and your project should be laid out like this: If this occurs, press ‘Next’ rather than ‘Finish,’ and type the layout-land path and filename in the subsequent dialog: At this point, Eclipse may warn you that “the destination file already exists” even though you are creating a file in a new (and completely empty!) folder. In this example, the path of our portrait layout file is res/layout/activity_main.xml so the landscape XML layout should be res/layout-land/activity_main.xml.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |