android:scrollbars="none" 則可以隱藏滾動(dòng)條
android:elevation="1dp" 添加陰影
在Android 5.X后也引入了一個(gè)叫tint的屬性阅虫,意思叫"著色"喝检,有兩種形式:
1、android:backgroundTint="" 2、android:tint=""
我們先來(lái)看一下圖片:這個(gè)主要是在xml文件里定義tint和tintMode2個(gè)屬性吴趴,其中tintMode有6個(gè)。
tintMode主要改變我們著色的模式P坠琛S圃邸!贾虽!一般情況默認(rèn)的模式是 src_in;
其余的把tintMode屬性分別設(shè)置為:add逃糟,multiply,screen,src_atop,src_in,src_over
app:popupTheme="@style/ThemeOverlay.xxxx"e,這個(gè)屬性就是用來(lái)自定義我們彈出的菜單的樣式蓬豁,在之前的Actionbar的溢出菜單绰咽,我們是不能自定義他的樣式的,只能根據(jù)你的theme來(lái)選擇黑白兩種地粪,不能自己定義取募,現(xiàn)在我們可以定義彈出菜單的樣式
在Android開(kāi)發(fā)中,使用ToolBar控件替代ActionBar控件蟆技,需要在java代碼中使用setSupportActionBar()方法
Class.getSimpleName()方法玩敏。是獲取源代碼中給出的‘底層類’簡(jiǎn)稱 而Class.getName();以String的形式,返回Class對(duì)象的‘實(shí)體’名稱
package com.test;
public interface Fruit {
}
一個(gè)實(shí)現(xiàn)類:
package com.test;
public class Apple implements Fruit {
}
Fruit apple=new Apple();
System.out.println(apple.getClass().getCanonicalName());//返回com.test.Apple
System.out.println(apple.getClass().getSimpleName());//Apple
System.out.println(apple.getClass().getName());//返回com.test.Apple
在DialogFragment的onstart()添加
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.dimAmount = 0.0f;
window.setAttributes(windowParams);
就是彈出框的周圍會(huì)透明
// Window window = getDialog().getWindow();
// window.setBackgroundDrawableResource(android.R.color.transparent);
就是彈出框自己變成透明
gradle-wrapper.properties中配置的是的Gradle的版本.
build.gradle中的依賴指定的是Android Gradle插件的版本.隨as下載下來(lái)的