From 5b545acbd16c53270a2d669e598260ca4c3f5ab9 Mon Sep 17 00:00:00 2001 From: Alexei Anoshenko Date: Thu, 26 May 2022 10:28:20 +0300 Subject: [PATCH] Updated Readme --- README-ru.md | 12 ++++++++++++ README.md | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/README-ru.md b/README-ru.md index 2434c68..3c9752f 100644 --- a/README-ru.md +++ b/README-ru.md @@ -467,6 +467,18 @@ View имеет ряд свойств, таких как высота, шири Данная функция ищет дочерний View с идентификатором id. Поиск начинается с rootView. Если View не найден, то функция возвращает nil и в лог записывается сообщение об ошибке. +При поиске можно задавать цепочку идентификаторов. В этом случае они разделяются символом '/'. +Например + + view := rui.ViewByID(rootView, "id1/id2") + +эквивалентно + + var view rui.View = nil + if view1 := rui.ViewByID(rootView, "id1"); view1 != nil { + view = rui.ViewByID(view1, "id2") + } + Обычно id устанавливается при создании View и в дальнейшем не меняется. Но это необязательное условие. Вы можете поменять id в любой момент. diff --git a/README.md b/README.md index 74d1d49..6868a6f 100644 --- a/README.md +++ b/README.md @@ -469,6 +469,18 @@ To do this, use the ViewByID function This function looks for a child View with id. The search starts from rootView. If View is not found, the function returns nil and an error message is written to the log. +When searching, you can specify a chain of identifiers. In this case, they must be separated by the '/' character. +For example + + view := rui.ViewByID(rootView, "id1/id2") + +equivalent to + + var view rui.View = nil + if view1 := rui.ViewByID(rootView, "id1"); view1 != nil { + view = rui.ViewByID(view1, "id2") + } + Usually id is set when the View is created and is not changed later. But this is an optional condition. You can change the id at any time.