Adding Footer View

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Footer View

mobiledev1600
Hi,

I am trying to add a Footer view with button in my table view. I found this code online

public override UIView GetViewForFooter(UITableView tableView, int sectionIndex)
{
        // Write a method to get the proper Section via the sectionIndex
        var section = GetSection(sectionIndex);
        if (section != null)
        {
                if (section.FooterView == null && !string.IsNullOrEmpty(section.FooterText))
                {
                         // Create your FooterView here
                        section.FooterView = CreateFooterView(tableView, section.FooterText);
                }
                                       
                return section.FooterView;
        }
                               
        return null;
}

I dont know what GetSection method is? I am having error "The name GetSection does not exist in the current context" .

I couldn't find any proper documentation on MonoTouch site as well.

Help is appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Adding Footer View

Nic Wise
Where did you find the code? Is there more context to it?

Basically, that method is called to get the footerview for any section
(a table has sections, a section has cells), so I'd guess that
GetSection is finding the correct section, so it can work out whats
ment to be in the footer view.

This is very similar to how MonoTouch.Dialog works, BTW.

On 28 March 2013 16:05, mobiledev1600 <[hidden email]> wrote:

> Hi,
>
> I am trying to add a Footer view with button in my table view. I found this
> code online
>
> public override UIView GetViewForFooter(UITableView tableView, int
> sectionIndex)
> {
>         // Write a method to get the proper Section via the sectionIndex
>         var section = GetSection(sectionIndex);
>         if (section != null)
>         {
>                 if (section.FooterView == null &&
> !string.IsNullOrEmpty(section.FooterText))
>                 {
>                          // Create your FooterView here
>                         section.FooterView = CreateFooterView(tableView, section.FooterText);
>                 }
>
>                 return section.FooterView;
>         }
>
>         return null;
> }
>
> I dont know what *GetSection* method is? I am having error "The name
> GetSection does not exist in the current context" .
>
> I couldn't find any proper documentation on MonoTouch site as well.
>
> Help is appreciated.
>
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/Adding-Footer-View-tp4658194.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch