我试图在用户点击按钮时显示loading.gif /旋转轮.我在母版页中添加了如下所示的div:
<div id="loadingDiv">
<div>
<h7>Please wait...</h7>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是css:
#loadingDiv{
position:absolute;
top:0px;
right:0px;
width:100%;
height:100%;
background-color:#666;
background-image:url('ajax-loader.gif');
background-repeat:no-repeat;
background-position:center;
z-index:10000000;
opacity: 0.4;
filter: alpha(opacity=40); /* For IE8 and earlier */
}
Run Code Online (Sandbox Code Playgroud)
当我尝试这个时,loading.gif显示在页面的中心.但由于页面很长,我必须滚动才能看到loading.gif.
如何在屏幕中央显示loading.gif?如果我向下滚动,我应该再次在屏幕中央看到它.
在更新到Android Studio 2.0预览版5之前,我使用com.android.tools.build:gradle:2.0.0-alpha3和gradle 2.8.它工作正常.
在我更新到2.0预览版5后,它告诉我更新到com.android.tools.build:gradle:2.0.0-alpha5和gradle 2.10.
我现在无法正常构建和运行我的应用程序.它总是使用我的代码的旧副本,虽然我已经更改了代码并花费了更多的时间来构建.
如果我回到com.android.tools.build:gradle:2.0.0-alpha3并且gradle 2.8.It变得正确.
Android Studio版本(http://tools.android.com/recent)
Android Gradle插件版本(http://tools.android.com/tech-docs/new-build-system)
Android Studio Preview 6于2016年1月21日发布.Android Studio Preview 7于2016年1月23日发布.
您可以看到Android Studio Preview经常更新.如果您不想处理各种错误,最好使用稳定版本.
如果要使用更多功能,则应始终保留最新版本以避免错误.
我认为它可以通过实现NestedScrollingChild NestedScrollingParent.
但我无法理解他们.谁可以帮助我!
产品经理坚持设计.
该ScrollView包含LinearLayout的"TabLayout"和ViewPager.
将ViewPager包含2个fragment包含RecyclerView或仅仅只有2 RecyclerView.
当ScrollView滚动到底部时,RecyclerView可以滚动到底.
当RecyclerView滚动到顶部时,ScrollView可以滚动到顶部.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="1000dp" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="60dp"></TableLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"></android.support.v4.view.ViewPager>
</LinearLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud) 我 compile project(':pickphotos') 用来包括一个名为pickphotos的库.
挑选照片中的R是红色虽然我有me.crosswall.photo.pick.RI可以正常构建和运行应用程序.
当我使用Alt + Enter时,它显示了一些解决方案:
当我在pickphotos中使用Move'R'时,它会显示一些R:
但是,如果我选择me.crosswall.photo.pick.R,我将在下一次构建中重复出现R错误.
下面是pickphotos的build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
dependencies {
}
Run Code Online (Sandbox Code Playgroud)
我也可以找到app/build/generated/source/r:
Android Studio中的菜单中没有标记为项目:
android android-library android-studio android-gradle-plugin
我Recyclerview在RecyclerViewPager(https://github.com/lsjwzh/RecyclerViewPager)中添加了一个项目.RecyclerView当我触摸它时,我想滚动.
我试过了 :
View.OnTouchListener listener = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_DOWN:
mRecyclerViewPager.requestDisallowInterceptTouchEvent(true);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mRecyclerViewPager.requestDisallowInterceptTouchEvent(false);
break;
}
return false;
}
};
mRecyclerView.setOnTouchListener(listener);
Run Code Online (Sandbox Code Playgroud)
但我有时只能滚动RecyclerView.
我认为它可以通过执行来sloved NestedScrollingParent的RecyclerViewPager或改变onTouchEvent的RecyclerViewPager.但我不熟悉他们.
android-recyclerview android-touch-event android-nestedscrollview
我想通过编程方式拨打某些预定义的号码来启动我的应用程序,这是一个隐藏的应用程序,例如*#*#111#*#*。打开拨号程序并输入*#*#111#*#*。然后我的应用程序接收广播并开始播放。我应该收听哪个广播?
当我运行我的应用程序时,它说
无法立即运行:Dalvik运行时的传统multi-dex
这是否意味着我在使用multi-dex时无法使用Instant Run?
我正在使用Android Studio beta4.
我刚刚在我的应用程序中实现了卡片视图,并希望在白色空间波纹管图像中放入2个不同的文本(一个是18dp,第二个是9dp).另外我想把箭头图像放在卡片视图的右侧.但我在那里遇到问题.如果我使用2个不同的Textviews,我不能将另一个在第一个下面.如果我只使用一个文本视图,我不能使文本有两种不同的大小.
这就是我在说的:
正如你所看到的,这只是一个Text视图,因为Text1\nText2
我不能把18dp的大小放到Text 1和9dp到Text 2.
任何解决方案?
这是XML代码:
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="@+id/Vjezbe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="2dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="10dp"
android:layout_weight="1"
card_view:cardBackgroundColor="#ffffff"
android:layout_marginTop="55dp"
android:onClick="Vjezbe">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="130dp"
android:id="@+id/imageView6"
android:background="#000000"
android:layout_marginBottom="3dp"
android:layout_row="0"
android:layout_column="0" />
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Text 1\nText 2"
android:id="@+id/textView25"
android:textSize="18dp"
android:layout_marginLeft="10dp"
android:layout_weight="0.9" />
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/imageView17"
android:background="@mipmap/strelica"
android:layout_marginRight="6dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="1dp" />
</TableRow>
</LinearLayout>
</android.support.v7.widget.CardView>
Run Code Online (Sandbox Code Playgroud)