2017-08-31 120 views
0

我還在學習Xamarin。我想問我是否可以修改從我的.resx文件中的字符串輸出的字體大小。我正在使用VS 2015,Xamarin Shared。以下是我的.resx文件中的一些內容。如何修改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> 

回答

0

您還可以將數字存儲在資源文件中。

<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); 
相關問題