Android Forums

Go Back   These FORUMS ARE DISABLED!! OUR NEW FORUMS ARE AT http://androidforum.com/ > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
 
 
LinkBack Thread Tools Display Modes
Old 02-15-2009, 08:18 PM   #1
Junior Member
 
Timo's Avatar
 
Join Date: Feb 2009
Posts: 2
Friends: 0
View Timo's Profile   View Timo's Photo Album   View Timo's Blog   View Social Groups
I have been trying to use the ExpandableList from the API-demos
(see example API demos -->views / expandable lists / custom adapter)
and alter it so the childs will display a EditText which has non-editable text as a backgound
(see example API demos --> views / layouts / linearlayouts / 10.BackgroundImage).

I am not able to get it to work.
Who can help me out with this one?
Attached Thumbnails
Add EditText with backgroundtxt to child of Expandable list?-screencap1.png   Add EditText with backgroundtxt to child of Expandable list?-screencap2.png  
Timo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
Old 02-21-2009, 09:17 PM   #2
Junior Member
 
Timo's Avatar
 
Join Date: Feb 2009
Posts: 2
Friends: 0
View Timo's Profile   View Timo's Photo Album   View Timo's Blog   View Social Groups
I seem to have figured it out myself.
I was looking in the wrong area.
The ListView is not made for displaying EditText.

My Solution was to use a ScrollView instead of a ListView:
Code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget28"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    
    
<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:addStatesFromChildren="true"
        android:gravity="center_vertical"
        android:paddingRight="0dip"
        android:background="@android:drawable/edit_text">

        <!--
            TextView label goes at the left.
        -->
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Lat: "
            android:textAppearance="?android:attr/textAppearanceLargeInverse"
        />

        <!--
            EditText goes in between.
        -->
        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:singleLine="true"
            android:background="@null"
        />
</LinearLayout>

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:addStatesFromChildren="true"
        android:gravity="center_vertical"
        android:paddingRight="0dip"
        android:background="@android:drawable/edit_text">

        <!--
            TextView label goes at the left.
        -->
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Lat: "
            android:textAppearance="?android:attr/textAppearanceLargeInverse"
        />

        <!--
            EditText goes in between.
        -->
        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:singleLine="true"
            android:background="@null"
        />
</LinearLayout>

</LinearLayout>
</ScrollView>
Timo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do You Change the Selected EditText Field Color? jon21569 Android Development, Answers, Tutorials, and Code Snippets 3 01-26-2010 05:51 AM
Task or To-Do List mezien Android Games And Applications 7 07-09-2009 04:06 PM
Help going from list view, to relevant text view. deenybird Android Development, Answers, Tutorials, and Code Snippets 0 02-04-2009 12:26 PM
Adding Button to List 'Go To', 'Bookmarks', 'Windows', Etc. with WebView ruben Android Development, Answers, Tutorials, and Code Snippets 0 06-20-2008 04:25 AM


Unlocked G1 Phones | Buy T-Mobile G1 | Google Phone

All times are GMT -6. The time now is 03:48 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright (c) 2012 TalkAndroid.com. All rights reserved.