我有一個UITableView位於視圖附加到SlidingPanel。無法讓UITableView滾動我的SlidingPanel內
我使用SlidingPanels.Lib,和我有一個自定義演示
Here's a gist of the custom presenter
從那裏我MenuView
真的是直線前進。
public class MenuView : ViewControllerBase
{
private new MenuViewModel ViewModel { get { return (MenuViewModel)base.ViewModel; } }
public override void ViewDidLoad()
{
base.ViewDidLoad();
// todo: this should actually be...
// _currentBookId = currentUser.UserBooks[0].BookId;
// _homeViewModel.ChapterViewModel = Mvx.Resolve<IChapterService>().FindByBookId(_currentBookId);
ViewModel.Chapters = Mvx.Resolve<IChapterService>().Find();
// this ensures the sliding panel doesn't fill the entire view.
var frame = View.Frame;
frame.Width = 300;
View.Frame = frame;
// var currentUser = Mvx.Resolve<IUserService>().GetById(Mvx.Resolve<UserModel>().Id);
var label = new UILabel(new RectangleF(10, 10, 300, 40))
{
TextColor = UIColor.White,
};
Add(label);
//var listHeight = (chapters.Count*40);
var navigationList = new UITableView(new RectangleF(0, 50, 300, 300))
{
Source = new NavigationTableSource(ViewModel.Chapters)
};
Add(navigationList);
var set = this.CreateBindingSet<MenuView, MenuViewModel>();
set.Bind(label).To(vm => vm.DisplayName);
set.Apply();
}
}
不幸的是,我不確定在哪裏尋找以允許TableView滾動。我可以看到它,但它超出了屏幕的底部。
我其實已經嘗試將高度設置爲300(這比視圖的高度更低),但它仍然拒絕滾動。 –
我剛剛更新了我的問題,並從示例中刪除了該行。對不起@stuart讓你當前的答案不相關。 –