Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Android
Screen Design Problem
Hardik Trivedi
Ranch Hand
Posts: 252
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I am designing a layout in android.Where I need one frame and button.The problem I can not make out this.
I tried LinearLayout-->FrameLayout-->Button
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" > <FrameLayout android:id="@+id/frame" android:layout_width="320dip" android:layout_height="375dip" android:background="#FF4682B4" > </FrameLayout> <Button android:id="@+id/b1" android:text="Clear" android:layout_width="wrap_content" android:layout_height="wrap_content" > </Button> </LinearLayout>
Exception is coming.
Ankit Garg
Sheriff
Posts: 9709
43
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You need to provide layout_width and layout_height on the LinearLayout too...
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
|
SCWCD Links
Ankit Garg
Sheriff
Posts: 9709
43
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Also to be able to view the button, you'll have to set the orientation of your linear layout to vertical...
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
|
SCWCD Links
Monu Tripathi
Rancher
Posts: 1369
1
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Not sure why you need two container Layouts(
LinearLayout
and
FrameLayout
). You are unnecessarily adding extra level in the view hierarchy.
[
List of FAQs
] | [
Android FAQ
] | [
Samuh Varta
]
brevity is the soul of wit - shakepeare. Tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
TabHost repeating tab content
how to add a scrollbar to a view
How to capture the current screen from device
nullpointer when i try to initiate onclicklistener
Layouts, bottom position
More...