Android equivalent of IBActions and IBOutlets

I am going to start with Android development.

What are the equivalents of IBActions and IBOutlets in android?

Isn't it as easy as Interface Builder to establish code connections?

Is it fast to learn the basics of Android development if you know java?

+3
source share
3 answers

To your last question, I would answer yes.

- , " ": id <Button android:id="@+id/myButton" /> XML, , View myButton = findViewById(R.layout.myButton). IBOutlet IB, , , . ( iPhone, .)

IBAction onClickListener, myButton.setOnClickListener(this); this View.OnClickListener. public void onClick(View v) v.id.

, . Android, , - .

, Java.

0

, , ( ) UI Android, Xcode/IB. , , . Microsoft, UI 15 ( Visual Basic Visual Studio). Android ( , Eclipse) MS, Xcode/IB, Visual Studio .

Android, iPhone, , , . iPhone, , , , , #/.NET .

+2

IBOutlets, IBActions AndroidDev eco, Visual Studio.

IBOUtlet .

Button but1 = (Button) findViewById(R.layout.but1)

IBAction .

//find Button b1 = ...
b1.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              //do something
          }
       }); 

    <Button
    android:id="@+id/button2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:onClick="button2Clicked"
    android:text="@string/text_but_1" />

xCode . ibOutlets ibActions - . , xml

Visual Studio , xCode. , , Android Developer, className.config.cs

androidStudio. , xCode VisualStudio. , , .

Android Developer Visual Studio , xCode. xCode . . , . Alt + Enter.

AndDev

# java , , , .

Alt + Enter! AndDev .

0

Source: https://habr.com/ru/post/1785612/


All Articles