[Solved]LinearLayout (in xml) to LinearLayout(in code)

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

[Solved]LinearLayout (in xml) to LinearLayout(in code)

Postby Rebirthing » Fri Dec 21, 2007 8:16 am

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="horizontal"
  6.  
  7.              android:layout_width="wrap_content"
  8.  
  9.              android:layout_height="wrap_content">
  10.  
  11.  
  12.  
  13.    <ImageView id="@+id/icon"
  14.  
  15.                          android:layout_width="wrap_content"  
  16.  
  17.             android:layout_height="wrap_content"
  18.  
  19.             android:layout_weight="0"            
  20.  
  21.             android:paddingTop="2px"
  22.  
  23.             android:paddingRight="5px"/>
  24.  
  25.  
  26.  
  27.    <TextView id="@+id/text"
  28.  
  29.             android:layout_width="wrap_content"  
  30.  
  31.             android:layout_height="wrap_content"/>        
  32.  
  33. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


I want to create instance of LinearLayout that matchs with XML.
Last edited by Rebirthing on Sat Dec 22, 2007 1:36 am, edited 1 time in total.
Rebirthing
Freshman
Freshman
 
Posts: 3
Joined: Fri Dec 21, 2007 8:03 am

Top

perhaps...

Postby Rebirthing » Fri Dec 21, 2007 9:20 am

ViewInflate is key?..

reading document..
Rebirthing
Freshman
Freshman
 
Posts: 3
Joined: Fri Dec 21, 2007 8:03 am

Postby plusminus » Fri Dec 21, 2007 4:41 pm

Hello Rebirthing,

you want the above transformed into Java-Code :?:

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

not exactly..

Postby Rebirthing » Sat Dec 22, 2007 1:41 am

I mean how to create instance of predesc xml resources.

I found the way to make it.

It's ViewInflate that make instance from xml.

thx :)
Rebirthing
Freshman
Freshman
 
Posts: 3
Joined: Fri Dec 21, 2007 8:03 am

Postby plusminus » Sat Dec 22, 2007 5:22 pm

Hello Rebirthing,

please post your code, so other can benefit from it :)

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 View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests