android - How to create xml's id?

前端 未结 3 1887
悲哀的现实
悲哀的现实 2021-01-01 12:12

I\'m developing a dynamic keyboard application using soft keyboard sample. My application changes layout. For example I have a keyboard(has one key) then I set up the app an

3条回答
  •  不知归路
    2021-01-01 12:21

    You can define ids using an ids.xml file in your res/values directory. Here's an example:

    
        
    
    

    In code, you would set the id like so:

    keyboardView.setId( R.id.my_keyboard );
    

提交回复
热议问题