android studio 自定义皮肤

创建一个自己皮肤的文件目录完成下面文件

  1. Create a new directory where you will save your skin configuration files.

  2. Define the visual appearance of the skin in a text file named layout. This file defines many characteristics of the skin, such as the size and image assets for specific buttons. For example:

    parts {
        device {
            display {
                width   320
                height  480
                x       0
                y       0
            }
        }

    portrait {


        background {
            image background_port.png
        }

        buttons {
            power {
                image  button_vertical.png
                x 1229
                y 616
            }
        }
    }
    ...

    }

  3. Add the bitmap files of the device images in the same directory.

  4. Specify additional hardware-specific device configurations in a hardware.ini file for the device settings, such as hw.keyboard and hw.lcd.density.

  5. Archive the files in the skin folder and select the archive file as a custom skin.

然后在android studio中将你的皮肤文件导入  也可以使用android studio自带的皮肤。

  1. Download Samsung Emulator Skins, You can download from here.

  2. After downloading, extract the zip file and copy it in the path Android Studio > plugins > android > lib > device-art-resources. (where x is the platform version number)

  3. Launch Android Studio.

  4. In Android Studio, go to Tools > Android > AVD Manager.

        Figure 1: Android Studio Window

Figure 1: Android Studio Window   In the AVD Manager, click "Create Virtual Device"

Figure 2: Creating a new virtual device

Figure 2: Creating a new virtual device  In the Virtual Device Configuration, click "New Hardware Profile"

Figure 3: Creating a new hardware profile

Figure 3: Creating a new hardware profile    Fill in the specifications for the skin you would like to use.

Figure 4: Configuring hardware profile

Figure 4: Configuring hardware profile   In the Default skin, select the folder of the zip file you extracted in the device-art-resources folder.

Figure 5: Selecting the default skin

Figure 5: Selecting the default skin     Select the system image you would like to use for your virtual device. Example: Lollipop

Figure 6: Selecting a system image

Figure 6: Selecting a system image

Verify all configurations are correct and click the finish button.

Figure 7: Verifying configurationFigure 7: Verifying configuration

The newly created virtual device appears on the AVD manager. To launch, select the virtual device and click the play icon.

Figure 8: Launch virtual deviceFigure 8: Launch virtual device

The Android emulator takes a few minutes to start, then appears:

Figure 9: Samsung Emulator

猜你喜欢

转载自blog.csdn.net/margin_0px/article/details/81484341