【问题标题】:How to modify font-size in .resx values in Xamarin?如何在 Xamarin 中修改 .resx 值中的字体大小?
【发布时间】:2017-08-31 07:14:00
【问题描述】:

我仍在学习 Xamarin。我想问一下如何修改从我的 .resx 文件中的字符串输出的字体大小。我正在使用 VS 2015,Xamarin 共享。以下是我的 .resx 文件中的一些内容。

    <data name="ERR_GENERAL_SERVER_ERROR_AUDIT" xml:space="preserve">
    <value>Ensure that the tablet is within WiFi coverage and try again. 

If within WiFi coverage please follow the below steps:
    1. Force Close WISview
        • WIS Issued Device: Click the circle at the bottom of the tablet and then click "Clear all processes"
        • Non WIS Issued Device: Click the square at the bottom of the device and then clicking the X on the WISview tile
    2. Re-open WISview and select “no” to the screen that prompts you to “use this inventory”
    3. Re-print a new Inventory Control barcode from the Laptop
    4. Scan the newly printed Inventory Control Barcode.

If still unable to begin audit of tag {0}, please contact helpline.</value>
    <comment>Error</comment>
  </data>

【问题讨论】:

    标签: c# visual-studio xamarin resx


    【解决方案1】:

    您还可以将数字存储在资源文件中。

    <data name="NotesLabel" xml:space="preserve">
        <value>Notes:</value>
        <comment>label for input field</comment>
    </data>
    
    <data name="NotesLabelFontSize" xml:space="preserve">
        <value>15</value>
    </data>
    

    此代码可能不会 100% 运行。但应该给你的想法:

    enter code here
    var myLabel = new Label ();
    
    // populate UI with translated text values from resources
    myLabel.Text = AppResources.NotesLabel;
    myLabel.FontSize = Convert.ToInt64(AppResources.NotesLabelFontSize);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-12
      • 1970-01-01
      • 1970-01-01
      • 2017-02-11
      • 2017-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多