Xingwei Zhu 3 年前
当前提交
d0f38a71
共有 4 个文件被更改,包括 84 次插入0 次删除
  1. 12
      Samples/UIWidgetsSamples_2019_4/Assets/StreamingAssets/button.png
  2. 7
      Samples/UIWidgetsSamples_2019_4/Assets/StreamingAssets/button.png.meta
  3. 62
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/NinegridImageSample.cs
  4. 3
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/NinegridImageSample.cs.meta

12
Samples/UIWidgetsSamples_2019_4/Assets/StreamingAssets/button.png

之前 之后
宽度: 50  |  高度: 50  |  大小: 4.6 KiB

7
Samples/UIWidgetsSamples_2019_4/Assets/StreamingAssets/button.png.meta


fileFormatVersion: 2
guid: 481359f485f8043998921732a41ec4d8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

62
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/NinegridImageSample.cs


using System.Collections.Generic;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Color = Unity.UIWidgets.ui.Color;
using Image = Unity.UIWidgets.widgets.Image;
using ui_ = Unity.UIWidgets.widgets.ui_;
namespace UIWidgetsSample {
public class NinegridImageSample : UIWidgetsPanel {
protected override void main() {
ui_.runApp(new NinegridWidgetApp());
}
}
class NinegridWidgetApp : StatelessWidget
{
public override Widget build(BuildContext context)
{
return new WidgetsApp(
color: Color.white,
home: new NinegridWidget(),
pageRouteBuilder: (settings, builder) =>
new PageRouteBuilder(
settings: settings,
pageBuilder: (Buildcontext, animation, secondaryAnimation) => builder(context)
)
);
}
}
public class NinegridWidget : StatefulWidget {
public override State createState() {
return new NinegridWidgetState();
}
}
class NinegridWidgetState : State<NinegridWidget> {
public override Widget build(BuildContext context) {
return new Center(
child: new Column(
children: new List<Widget>
{
Image.file(
"button.png",
height: 100,
width: 350,
centerSlice: Rect.fromLTRB(15, 15, 35, 35)
),
Image.file(
"button.png",
height: 100,
width: 350,
fit: BoxFit.fill
)
}
)
);
}
}
}

3
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/NinegridImageSample.cs.meta


fileFormatVersion: 2
guid: 7ad4b293e355428a9c0466ff7d1cde83
timeCreated: 1640663019
正在加载...
取消
保存