I have a layout with a listview and below it a "toolbar" I want the list to be scrollable i Used verticaloptions="fillandExpand" but doesn't help
The following is my layout
<?xml version="1.0" encoding="utf-8"?>
<Toolbar android:id="@+id/toolbar_bottom" android:minHeight="?android:attr/actionBarSize" android:background="?android:attr/colorAccent" android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar" android:popupTheme="@android:style/ThemeOverlay.Material.Light" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"/>
Looking foward to your kind help
Regards
M.R
1.In activity EventListActivity
, the SimpleCursorAdapter
use layout EventListItem
as the item layout.
var adapter = new SimpleCursorAdapter(this, Resource.Layout.EventListItem, cursor, sourceColumns, targetResources) { ViewBinder = new ViewBinder() };
2.In activity EventListItemActivity
, you use layout EventListItem
as the page layout.
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.EventListItem); // other code }
So, you used the same layout EventListItem
.
Answers
@meirrotfleisch Can you post the complete content including the ListView implementation? The current XML only shows the Toolbar.
.
.
.
.
.
.
Looking for Free* Microsoft Support on Xamarin Issues, visit https://aka.ms/xamarinsupport
Hi
Attached is the Activity.cs for the layout..
Thanks for your time and efforts
Regards
M.R.
Forgot to add the Usings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Provider;
using Android.Database;
using Java.Util;
using TimeZone = System.TimeZoneInfo;
using Java.Lang;
using Android.Text.Format;
using Java.Text;
using System.Threading.Tasks;
using Java.Util.Functions;
using Android.Preferences;
Regards
M.R.
@meirrotfleisch Thanks for sharing the ListView implementation. I also need to see the XML file. Since the data is getting displayed for you except the scroll is not working as you mentioned initially, need to see the XML.
.
.
.
.
.
Looking for Free* Microsoft Support on Xamarin Issues, visit https://aka.ms/xamarinsupport
Hi
Again thanks for your attention and swift responses.. Attached is the xnml. Hope this helps
Regards
Meir
Hi @meirrotfleisch, from the code you posted , I found that you didn't post the full code.
What's the code of
MyUtils
andMyReceiver
?If it is convenient for you, could you please post a basic demo so that we can test on our side?
Regards
Hi
I'm pretty sure i'v narrowed the problem down to the combination of Bottom_toolbar and listview.
Ill try to create a demo of the situation later on.
in the mean time Any suggestions?
Regards
HI
My app is based on this original demo. I added the "bottom_toolbar" to the EventList.axml and the EventListActivity.cs
Here the scroll will work but if the list is long the toolbar doesn't show.
Rather confusing.. Why its reacting differently
Thanks .. Looking forward to your helpful responses
Regards
M.Rotfleisch
You just need to add the following property for your listview:
@jezh
Thanks..
This seems to have helped a bit . but I still seem to be getting a "toolbar" between each item of the listview
See attached screen shot (from the real app not the demo)
Regards
M.R.
I have modified some codes and added the runtime permission in your code , and I also tesed on my device, it works properly.
I have uploaded the demo in the attachment, you can check it here.
@jezh : Thanks again for your time.
When I try to install your demo on a Samsung Galaxy s5 after the request for calendar permissions i get a message saying "screen Overlay detected" and that i need to turn off screen overlay from Settings >apps. Tried to but still it wont load
When I install on my other device Samsung Galaxy S5 it runs correctly.
However on my full app (added many features) I still haven't been able to get rid of the "blank toolbar" between each Listed Event.
I'm attaching my full code here
Regards
Meir
In the
EventListItem.axml
, you have defined aToolbar
in the layout.You can just remove theToolbar
.After I removed the toolbar, the result is:

@jezh That solves it for the Alarms List but then when I want to go to the Details (click item in EventList) the EventListItem no longer has its toolbar ...
Regards
M.R.
You can create a new layout for this activity(the Details (click item in EventList)).
Or just hide the toolbar in
EventListActivity
and display it inEventListItemActivity
.and
@jezh
I guess my challenge here is how/where are the two layouts being "combined"?
Regards
M.R.
1.In activity
EventListActivity
, theSimpleCursorAdapter
use layoutEventListItem
as the item layout.2.In activity
EventListItemActivity
, you use layoutEventListItem
as the page layout.So, you used the same layout
EventListItem
.@jezh thanks for all your hard work and help
m.r.
It's my pleasure to help you. Have a nice day.