我创建了一个简单的Xamarin表单项目并编辑了您发布的Xaml文件,还添加了两个resx文件:appresources.resx和appresources.fr.resx,然后将模拟器的语言设置设置为法语。一切正常。我想你可能漏掉了什么,所以我把代码贴在这里:
主页.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:App34"
x:Class="App34.MainPage">
<StackLayout>
<!-- Place new controls here -->
<Label Text="Welcome to Xamarin.Forms!"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" />
<Label x:Name="String1"
FontAttributes="Bold"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage>
主页.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace App34
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
String1.Text = AppResources.String1;
}
}
}