简体   繁体   中英

Renaming Buttons in different Layouts Issue Android/Java

i created different Android Layout XMLs by copying different Layouts with Buttons, TextViews etc. from one XML to another. Now there is the Problem that when renaming the iD from one Button in one Layout the Button-ID Changes in all Layout XML files. I am a Rookie in programming and my english isn't that good but it would be very nice if someone may help. Searching for this Problem via g00gle doesn't success..

test_layoutA.xml equal to test_layoutB.xml:

 <ImageButton
                android:id="@+id/btnChatF"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:src="@drawable/testbuttonimage" />

If you Need more Information please ask, thank you very much.

If you rename by altering XML directly, then IDE will not catch that and won't populate the change. You should either use Refactor -> Rename... function on that field, or rename using Properties sheet, while in graphical editor.

我认为在尝试了几种布局之后,避免此“错误”的唯一方法是使用文本编辑器(而不是“属性”编辑器)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM