Border LAyout

Put your problem here if it does not fit any of the other categories.

Border LAyout

Postby zeeshan » Wed Mar 05, 2008 7:22 am

i want o create a border layout like

imageview

top border

left border listview right border


bottom border

i can easily change the border color whenever i want.

please give me an working example
zeeshan
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Mar 03, 2008 6:10 am

Top

Postby plusminus » Wed Mar 05, 2008 9:49 am

Hello zeeshan,

I assume you'll find nobody doing your work. But many people like to help you on problems you experience.

So I guess you should use a RelativeLayout, because using that you can define the position of the Views relative to each other. So a BorderLayout is doable.

Small example: viewtopic.php?t=58

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby zeeshan » Wed Mar 05, 2008 10:28 am

i am doing like this it should work i think

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.  android:orientation="vertical"
  6.  
  7.  android:layout_width="fill_parent"
  8.  
  9.  android:layout_height="fill_parent">
  10.  
  11. <!-- Top -->
  12.  
  13.   <LinearLayout android:name="@+id/top_container"
  14.  
  15.    android:orientation="horizontal"
  16.  
  17.    android:layout_weight="0"
  18.  
  19.    android:layout_width="fill_parent"
  20.  
  21.    android:layout_height="wrap_content"
  22.  
  23.    android:background="@drawable/rive_point_main_screen">
  24.  
  25.  
  26.  
  27.   </LinearLayout>
  28.  
  29.  
  30.  
  31.   <!-- Central row -->
  32.  
  33.   <LinearLayout android:orientation="horizontal"
  34.  
  35.    android:layout_weight="1"
  36.  
  37.    android:layout_width="fill_parent"
  38.  
  39.    android:layout_height="fill_parent">
  40.  
  41.        
  42.  
  43.     <LinearLayout android:name="@+id/left_container"
  44.  
  45.      android:orientation="vertical"
  46.  
  47.      android:layout_weight="0"
  48.  
  49.      android:layout_width="wrap_content"
  50.  
  51.      android:layout_height="fill_parent"
  52.  
  53.      android:background="@drawable/rive_point_main_screen">
  54.  
  55.     </LinearLayout>
  56.  
  57.  
  58.  
  59.     <LinearLayout android:name="@+id/center_container"
  60.  
  61.      android:orientation="vertical"
  62.  
  63.      android:layout_weight="1"
  64.  
  65.      android:layout_width="fill_parent"
  66.  
  67.      android:layout_height="fill_parent">
  68.  
  69.      
  70.  
  71.          <ImageView  
  72.  
  73.    android:layout_width="fill_parent"
  74.  
  75.    android:layout_height="wrap_content"    
  76.  
  77.    android:orientation="horizontal"
  78.  
  79.    android:src="@drawable/logo"
  80.  
  81.     android:layout_weight="1"
  82.  
  83.         android:layout_gravity="center_vertical"/>
  84.  
  85.        
  86.  
  87.     </LinearLayout>
  88.  
  89.  
  90.  
  91.     <LinearLayout android:name="@+id/right_container"
  92.  
  93.      android:orientation="vertical"
  94.  
  95.      android:layout_weight="0"
  96.  
  97.      android:layout_width="wrap_content"
  98.  
  99.      android:layout_height="fill_parent"
  100.  
  101.         android:background="@drawable/rive_point_main_screen">
  102.  
  103.     </LinearLayout>
  104.  
  105.  
  106.  
  107.   </LinearLayout>
  108.  
  109.  
  110.  
  111.   <LinearLayout android:name="@+id/bottom_container"
  112.  
  113.    android:orientation="horizontal"
  114.  
  115.    android:layout_weight="0"
  116.  
  117.    android:layout_width="fill_parent"
  118.  
  119.    android:layout_height="wrap_content"
  120.  
  121.       android:background="@drawable/rive_point_main_screen">
  122.  
  123.   </LinearLayout>
  124.  
  125.  
  126.  
  127. </LinearLayout>
Parsed in 0.007 seconds, using GeSHi 1.0.8.4
zeeshan
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Mar 03, 2008 6:10 am

Postby zeeshan » Wed Mar 05, 2008 10:34 am

but its not working and one thing more can we define foreign key in sqlite database ?
zeeshan
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Mar 03, 2008 6:10 am

Postby plusminus » Wed Mar 05, 2008 11:35 am

Hell zeeshan,

I can see really many LinearLayouts without content... and I cannot see RelativeLayout once.

Using wrap_content with actually no content inside makes the View/Layout 0px thin :!:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. android:layout_height="wrap_content"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

You'll find really many working Layouts here on anddev.


@SQlite: I'm pretty sure we cannot (not looked it up in the )
Because even on full mySQL only InnoDB (?) supports ForeignKeys ( and not just swallows without doing something ).

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby zeeshan » Wed Mar 05, 2008 11:48 am

then how would i define relationships in tables ?

i have two tables

how can i define relationships between them
coupon


coupon_used

please i am not getting any output regarding border layout ..
give me any working example will be greatfull to you.
Thanks
zeeshan
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Mar 03, 2008 6:10 am

Top

Postby plusminus » Wed Mar 05, 2008 11:54 am

Hello zeeshan,

consider the following attributes using a RelativeLayout:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. android:layout_alignParentBottom="true"
  2. android:layout_alignParentTop="true"
  3. android:layout_alignParentRight="true"
  4. android:layout_alignParentLeft="true"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. android:layout_above="@+id/otherview"
  2. android:layout_below="@+id/otherview"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 16 guests