Get error with string xml

Shay Wilner 1,746 Reputation points
2023-08-26T21:53:54.2966667+00:00

Hello

I add in strings.xml

<string name="Type pixel number for upper left corner">titleplx</string>

when i compiled the app i get this errorstringerror

Developer technologies .NET Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    2023-08-28T01:48:59.41+00:00

    Hello,

    Upon investigation, it turns out that this error occurs because your string name contains spaces and the string cannot be instantiated.

    If you need to use a phrase as a variable name, use an underscore or camel to name it.

    <string name="Type_pixel_number_for_upper_left_corner">titleplx</string>

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.