rou*_*sis 2 android xamarin.android
所以我面临的问题不是主观判断什么对用户最好(我认为),但有哪些选项可用于说明定位.
想想某种团队运动应用程序,你可以为玩家添加小点(然后我可以用代表玩家的一些UI组件替换点)这样的东西
你可以拖放红色和蓝色圆点
我尝试使用gridview,这很难,因为我需要有一定数量的行/列,当你在一个分辨率更高的手机时它们不会缩放,所以开始攻击"自定义组件"了感觉我正在重新发明轮子.
有没有比写我自己的组件更好的选择?
如果它有任何区别,我使用xamarin.android
我将使用MvvmCross数据绑定对集合绑定的FrameLayout实现这一点.
该方法的核心使用父级中父级内的子级s 的TranslationX和TranslationY属性.ViewFrameLayout
家长是:
<?xml version="1.0" encoding="utf-8"?>
<pointsongrid.BindableFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/points.on.grid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
local:MvxBind="ItemsSource Points"
local:MvxItemTemplate="@layout/item"/>
Run Code Online (Sandbox Code Playgroud)
列表项是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/points.on.grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
local:MvxBind="TranslationX X, Converter=X;TranslationY Y, Converter=Y"
>
<LinearLayout
android:layout_width="20dp"
android:layout_height="20dp"
local:MvxBind="BackgroundColor Color, Converter=NativeColor"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
local:MvxBind="Text Player"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
StackOverflow的整个代码有点长,所以我发布了一个快速回购来演示 - https://github.com/slodge/MvvmCross-Players - 数据绑定FrameLayout当然可以改进 - 看看下面的LinearLayout代码如果你需要支持更改列表(例如ObservableCollection),那么主要的MvvmCross repo可以提供一些想法.
结果看起来有点像:

| 归档时间: |
|
| 查看次数: |
270 次 |
| 最近记录: |