我使用uwp导航示例作为我的应用程序导航的示例.我需要将重点放在TextBox上.我试试uwp导航示例.对于BasicPage,我添加以下代码:
<StackPanel Orientation="Vertical">
<TextBox x:Name="Test" />
<TextBox x:Name="Test1" />
</StackPanel>
public BasicPage()
{
this.InitializeComponent();
this.Loaded += BasicPage_Loaded;
}
private void BasicPage_Loaded(object sender, RoutedEventArgs e)
{
Test1.Focus(FocusState.Programmatic);
}
Run Code Online (Sandbox Code Playgroud)
Test1没有得到关注.我在"普通"Windows通用应用程序中尝试此代码 - 这是工作.你有什么建议?
我在 Figma 中有一个设计。看起来不错。但是当我尝试在 flutter 中使用字体值时 - 我遇到了问题。我在 Figma 上选择的字体大小应用程序的前端并没有为肉眼呈现相同的结果。
例如,如果我在 Figma 上设置文本的 12px 大小,并在 flutter 的前端文件上设置相同的 (12px) 大小,则生成的结果不匹配;Flutter 的应用程序字体大小似乎比 Figma 屏幕小,但它们的大小(以 px 为单位)设置为相同。
这是我的文本样式的示例:
final textMedium = GoogleFonts.manrope(
textStyle: TextStyle(
fontWeight: FontWeight.w700,
fontStyle: FontStyle.normal,
fontSize: 12,
color: Colors.black
));
Run Code Online (Sandbox Code Playgroud)
可能是什么原因以及如何解决?我需要一个“修正系数”。有什么建议吗?
现在我正在努力更新我的应用程序的UI(XF for Android).我找到了这个appbar的UI解决方案(来自源代码Evolve 2016):
它看起来很漂亮,简单实现:
<ContentPage.Content>
<Grid RowSpacing="0" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackLayout BackgroundColor={StaticResource Primary}, Grid.Row=0/>
<SearchBar/>
</StackLayout>
<StackLayout Grid.Row=1>
//other content
</StackLayout>
.....
Run Code Online (Sandbox Code Playgroud)
对于现有导航(Master-Detail),它工作正常.但我点击项目(在此页面上) - 而不是打开新页面(没有主要细节).像这样工作:
await Navigation.PushAsync(new SessionDetailPage(), true);
Run Code Online (Sandbox Code Playgroud)
我单击工具栏上的 - 返回会话页面,而不是短时间显示白线
它不会持续很久,一瞬间.然后白线消失了.但它使用起来很不愉快.有任何想法吗?我怎样才能改善这个?
我使用Visual Studio Team Services.我转到 - 我的个人资料 - 区域设置 - 选择其他语言.但浏览器中的语言有英文版.如何在Visual Team Services中更改语言?
我为uwp创建了应用程序(赢得10台桌面).我无法为商店建立包装.我收到一个错误:有必要更新证书.我已更新证书并构建我的包.但是当我将包上传到商店时,我收到错误:
Invalid package family name: MyPackage.xxxx_xxxx (expected: MyPackage.yyyy_yyyyy)
Invalid package publisher name: CN=XYX (expected: CN=xxx-xxxx-xxx-xxxx)
Run Code Online (Sandbox Code Playgroud)
但我打开了我的应用清单,我看到:
Published: CN=xxx-xxxx-xxx-xxxx
Package Family Name: MyPackage.yyyy_yyyyy
Run Code Online (Sandbox Code Playgroud)
这是预期的.在"公开证明"中我看到:Publisher -XYX.
我该如何解决这个问题?有任何想法吗?
我需要更改我的 flutter 应用程序中的应用栏高度。我使用这段代码:
Widget build(BuildContext context) {
return Scaffold(
appBar: PreferredSize(
preferredSize: Size.fromHeight(100.0),
child: AppBar(
automaticallyImplyLeading: false,
flexibleSpace: Container(),
centerTitle: true,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Icon(Icons.search),
Icon(Icons.home),
PopupMenuButton<String>(
icon: Icon(Icons.menu),
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
PopupMenuItem<String>(
value: "1",
child: Text('Hello'),
),
PopupMenuItem<String>(
value: "2",
child: Text('World'),
),
]
)
],
),
),
),
body: Container());
}
Run Code Online (Sandbox Code Playgroud)
这是我的结果:
高度已经改变,但我需要将内容垂直居中对齐。我尝试这个选项,但它不起作用:
automaticallyImplyLeading: false,
flexibleSpace: Container(),
centerTitle: true,
Run Code Online (Sandbox Code Playgroud)
有什么建议吗?
我有安卓应用。我使用 BLE(蓝牙低功耗)连接到设备。效果很好,但我在 Android 10 上有问题。这是我的代码:
Hashtable<String, BluetoothDevice> myHtDevices;
....
BluetoothGatt gatt = myHtDevices.get(deviceId).connectGatt(this, false, gattCallback);
Run Code Online (Sandbox Code Playgroud)
在 onConnectionStateChange 我得到:
//public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState){
status= 133,
newStatus =0,
Run Code Online (Sandbox Code Playgroud)
我只有 Android Q 有这个问题。
我试过这个方法(添加参数TRANSPORT_LE),但它不起作用:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q){
gatt = myHtDevices.get(deviceId).connectGatt(this, false, gattCallback,
BluetoothDevice.TRANSPORT_LE);
}
else {
gatt = myHtDevices.get(deviceId).connectGatt(this, false, gattCallback);
}
Run Code Online (Sandbox Code Playgroud)
添加信息:
我通过执行 BLE 扫描获得 myHtDevices。
我马上回电过来。
设备-三星9
这是 nRF 连接日志:
nRF Connect, 2020-03-24
Device (50:8C:B1:52:B7:8D)
V 19:37:26.248 Connecting to 50:8C:B1:52:B7:8D...
D 19:37:26.248 gatt = device.connectGatt(autoConnect = …Run Code Online (Sandbox Code Playgroud) 我将此插件用于我的 Xamarin Forms 应用程序(android)。当应用程序在后台时不会触发任何事件。事件在应用程序处于前台时起作用。但是应用程序是后台任何未触发的事件,该应用程序才刚刚打开。但是我需要将消息参数传递给应用程序。我不确定这是否是一个错误,也许这是我的错误。我将不胜感激任何帮助。我使用这个 api 发送消息:
https://fcm.googleapis.com/fcm/send
这是我的有效载荷:
{
"data": {
"id_serv" : "12",
"id_group" : "1",
"click_action":"Accept"
},
"notification" : {
"body" : "test",
"title" : "test"
},
"priority": "high",
"condition": "'g1' in topics"
}
Run Code Online (Sandbox Code Playgroud)
我还订阅了所有可用事件 - OnNotificationAction、OnNotificationOpened、OnNotificationReceived。我也尝试在 android 级别订阅,但这也不起作用。有什么帮助吗?
android push-notification xamarin.android firebase xamarin.forms
我有设计 Figma,我需要将其应用到我的 flutter 应用程序中。但我有一定的困难,所以按顺序。
我尝试的第一件事是使用自动导入工具,我尝试过:
Adobe XD 到 Flutter
超新星工作室
不幸的是,这些工具仍处于其旅程的开始阶段。它们提供了一些好处,但不提供完全导入
我还使用 Figma 的几个插件:
Figma 扑腾
Figma 到代码
但这些插件的功能也是有限的。我意识到我需要自己做。
Figma 页面尺寸为 320 像素。设备屏幕尺寸会有所不同。但我需要它看起来尽可能接近。我决定采用“比例法”。我正在使用带有以下扩展名的Figma元素的尺寸:
//SizeConfig
screenWidth = _mediaQueryData.size.width;
screenHeight = _mediaQueryData.size.height;
.....
extension SizeDoubleExt on double {
double h() {
double screenHeight = SizeConfig.screenHeight;
var res = (this / 693.0) * screenHeight;
return res;
}
double w() {
double screenWidth = SizeConfig.screenWidth;
var res = (this / 320.0) * screenWidth;
return res;
}
}
Run Code Online (Sandbox Code Playgroud)
例子:
return Container( width: 80.w(), );
Run Code Online (Sandbox Code Playgroud)
但结果并不令我满意。也许我需要考虑devicePixelRatio(逻辑像素),或者“比例方法”是错误的。 …
user-interface responsive-design flutter flutter-layout figma
我有一个带有我域的类的程序集-“ Domains.dll”。我将动态添加到程序集的DbContext Dbset加载类中。
public class MyContext : DbContext
{
public MyContext() : base("DBConnection"){}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
Assembly assembly = Assembly.LoadFrom("Domains.dll");
var entityMethod = typeof(DbModelBuilder).GetMethod("Entity");
var list = assembly.GetTypes().OrderBy(i => i.GetType().Name);
foreach (Type item in list)
{
entityMethod.MakeGenericMethod(item)
.Invoke(modelBuilder, new object[] { });
}
}
}
Run Code Online (Sandbox Code Playgroud)
接下来,我创建数据库
context.Database.Create();
Run Code Online (Sandbox Code Playgroud)
这可行,但是我的域存在问题。我有一个上级实体类
public abstract class Entity
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
}
public class Person : Entity
{
public string FirstName {get ;set;}
public string LastName …Run Code Online (Sandbox Code Playgroud) flutter ×3
android ×2
c# ×2
dart ×2
figma ×2
windows-10 ×2
azure-devops ×1
bluetooth ×1
certificate ×1
code-first ×1
dynamic ×1
firebase ×1
focus ×1
model ×1
tfs ×1
uwp ×1
xaml ×1