Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Port XCode to CSharp

Im porting XCode code from https://github.com/bharath2020/UITableViewTricks into an Ios Xamarin Project.

I have already done all the translation from XCode to Csharp, things seems to work, minor alignment bug, but it's work.

But i still need help for a part that i don't understand.

In BBTableView.m We got a line with this

contentAlignment = eBBTableViewContentAlignmentLeft;

I see a line that seems to set this eBBTableViewContentAlignmentLeft params in BBTableView.h

If i understand this right i can define this in TableView.designer.cs but i can't figure out to do this in Csharp.

like image 612
Leze Avatar asked May 20 '26 16:05

Leze


1 Answers

Three simple things to do.

1- Define your Enum

enum EBBTableViewContentAlignment{
     eBBTableViewContentAlignmentLeft,
     eBBTableViewContentAlignmentRight
};

2- Delaration

EBBTableViewContentAlignment contentAlignment;

3- Assignment

contentAlignment = EBBTableViewContentAlignment.eBBTableViewContentAlignmentLeft;
like image 171
imrn Avatar answered May 23 '26 06:05

imrn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!