使用图层列表在Android Splash屏幕上调整图像大小

时间:2019-03-26 23:52:44

标签: android

如何调整屏幕大小以使其更集中在页面上

initial_screen.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">


     <item
         android:drawable="@android:color/white"/>
     <item>

         <bitmap
            android:gravity="center"
            android:src="@drawable/fsa2"/>
    </item>


</layer-list>

Splash Screen

1 个答案:

答案 0 :(得分:1)

您可以使用ImageView并将其可绘制资源设置为:

if (a+b<=c)
{
    JOptionPane.showMessageDialog(null,"Invalid Triangle");
} else if (a==c) {
       JOptionPane.showMessageDialog(null,"Triangle is Equilateral"); 
} else if (a==b || b==c){
        JOptionPane.showMessageDialog(null, "Triangle is Isosceles");
} else {
    JOptionPane.showMessageDialog(null,"Triangle is Scalene");
}