thank you for advice.
i can show 3 views by using LinearLayout.
<LinearLayout android:layout_width="wrap_content"
android:layout_height="fill_parent" android:id="@+id/empty">
<ImageView android:id="@+id/emptyImage"
android:src="@drawable/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button android:id="@+id/emptyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
i wonder why i couldn't show these views at first time, so i get file
from cvs and check it.
it is using LinearLayout inside LinearLayout.
<LinearLayout android:layout_width="wrap_content"
android:layout_height="fill_parent" android:id="@+id/empty">
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imagelayout">
<ImageView android:id="@+id/emptyImage"
android:src="@drawable/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/buttonlayout">
<Button android:id="@+id/emptyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
i don't know why not using RelativeLayout.
if i cen get time to recreate layout, i will chenge LinearLayout to
RelativeLayout.
# now i can get clear understanding of [set] and [add]. thn.ak you.
# next time if i write mail like this, i will set title to "doesn't work".
thanks.
2011/4/28 Dianne Hackborn <[email protected]>:
> Btw you can pretty uniformly take a function that starts with "set" on
> Android to mean "replace whatever you previously had with the new value
> being supplied."
>
> On Thu, Apr 28, 2011 at 8:39 AM, Dianne Hackborn <[email protected]>
> wrote:
>>
>> No. There is only one empty view. If you want an empty view with
>> multiple things in it, use a layout manager and put your views inside and
>> set the top-level layout manager as the empty view.
>>
>> On Wed, Apr 27, 2011 at 11:15 PM, kenichi kato <[email protected]>
>> wrote:
>>>
>>> hi guys.
>>>
>>> i try to set 3 empty view to ListView.
>>>
>>> at first, i try to set LinearLayout to EmptyView.
>>> but it doesn't work.
>>>
>>> so, i try this code.
>>> listView.setEmptyView(findViewById(R.id.emptyImage));
>>> listView.setEmptyView(findViewById(R.id.emptyButton));
>>> listView.setEmptyView(findViewById(R.id.emptyText));
>>>
>>> but it shows only R.id.emptyImage.
>>>
>>> is there any way to set mutilple EmptyView to ListView?
>>>
>>> thanks.
>>>
>>> --
>>> ---------------------------------------------
>>> smokerpg
>>> PC: [email protected]
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>>
>>
>> --
>> Dianne Hackborn
>> Android framework engineer
>> [email protected]
>>
>> Note: please don't send private questions to me, as I don't have time to
>> provide private support, and so won't reply to such e-mails. All such
>> questions should be posted on public forums, where I and others can see and
>> answer them.
>>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
---------------------------------------------
smokerpg
PC: [email protected]
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en