2016-08-22 4 views
0

Syncfusion SfNavigationDrawerを使用してを作成しようとしていますが、アンドロイドシミュレータで次の例外が発生します。ナビゲーションドロワーを使用しているときに `Java.Lang.NoSuchMethodError`例外が発生しました

Java.Lang.NoSuchMethodError: no method with name='setClipToOutline' signature='(Z)V' in class Lcom/xamarin/forms/platform/android/FormsViewGroup;

これは私のコードです:

public class MainPage : ContentPage 
{  
    public MainPage() 
    { 
     SfNavigationDrawer nav = new SfNavigationDrawer(); 

     StackLayout mainStack = new StackLayout(); 
     mainStack.Opacity = 1; 
     mainStack.Orientation = StackOrientation.Vertical; 
     mainStack.HeightRequest = 500; 
     mainStack.BackgroundColor = Color.White; 

     ObservableCollection<String> list = new ObservableCollection<string>(); 
     list.Add("Home"); 


     ListView listView = new ListView(); 
     listView.WidthRequest = 200; 
     listView.VerticalOptions = LayoutOptions.FillAndExpand; 
     listView.ItemsSource = list; 
     mainStack.Children.Add(listView); 

     nav.DrawerContentView = mainStack; 


     StackLayout headerLayout = new StackLayout(); 
     headerLayout.Orientation = StackOrientation.Vertical; 

     Image image = new Image(); 
     image.Source = ImageSource.FromFile("user.png"); 
     headerLayout.Children.Add(image); 

     Label header = new Label(); 
     headerLayout.Children.Add(header); 
     nav.DrawerHeaderView = headerLayout; 



     Button imageButton = new Button(); 
     imageButton.WidthRequest = 50; 

     Label homeLabel = new Label(); 
     homeLabel.Text = "Home"; 
     homeLabel.FontSize = 15; 
     homeLabel.TextColor = Color.White; 
     homeLabel.HorizontalTextAlignment = TextAlignment.Center; 
     homeLabel.VerticalTextAlignment = TextAlignment.Center; 

     StackLayout headerFrame = new StackLayout(); 
     headerFrame.Orientation = StackOrientation.Horizontal; 
     headerFrame.Children.Add(imageButton); 
     headerFrame.Children.Add(homeLabel); 

     Label mainLabel = new Label(); 
     mainLabel.Text = "Lorem..."; 

     StackLayout ContentFrame = new StackLayout(); 
     ContentFrame.Orientation = StackOrientation.Vertical; 
     ContentFrame.BackgroundColor = Color.White; 
     ContentFrame.Children.Add(headerFrame); 
     ContentFrame.Children.Add(mainLabel); 
     nav.ContentView = ContentFrame; 

     nav.Position = Position.Left; 
     nav.Transition = Transition.SlideOnTop; 

     this.Content = nav; 

    } 
} 

私はXamarin.Forms 2.3.0.49を使用して、そしてSyncfusion ES 14.2.0.26です。そして、私はXamarinAndroid build-toolsを更新しても助けにならなかったことに注意してください。

答えて

1

私は同じ問題を抱えていました。 ここにSyncfusionサポートチームの回答があります: 最新のEssential Studio Volume 2 Service Pack 2、2016(バージョン14.2.0.32)で報告されているクラッシュ「名前なしのメソッドsetClipOutline」が修正され、続くリンク。

https://www.syncfusion.com/forums/125638/essential-studio-2016-volume-2-service-pack-release-v14-2-0-32-available-for-download

問題は解決しました。

1

これはlibの既知のバグです。フォーラムhereの最新の投稿を参照してください。 this threadthisの代替ソリューションを使用してみてください。リンクからの要約で

https://www.syntaxismyui.com/xamarin-forms-masterdetail-page-navigation-recipe/

https://varunrathore.wordpress.com/2015/03/10/xamarin-forms-navigation-drawer/

http://xforms-kickstarter.com/#a-slide-out-menu-using-a-master-detail-page

http://blog.falafel.com/xamarin-creating-a-sliding-tray/

はそれが役に立てば幸い!

関連する問題