重命名应用程序包名称后,Android Studio显示此错误 can't resolve symbol AppCompatActivity
我试过的事情:
但没有什么真正帮助.项目构建成功,但我不能使用语法高亮.
我用了 com.android.support:appcompat-v7:23.1.1
截图
我正在寻找一种方式,如何使用android共享意图分享一个文本到社交网络.几乎每个人都提供此代码
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, sometext);
startActivity(Intent.createChooser(shareIntent, "Share using"));
Run Code Online (Sandbox Code Playgroud)
但它不适用于Facebook.有没有办法与所有网络共享文本.谢谢.
尝试新的Android设计库我发现了工具栏阴影的错误.使用CollapsingToolbarLayout时,仅当工具栏折叠时,工具栏下方的阴影才会出现.当我们展开它时,阴影消失了.我的布局看起来像
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/user_avatar_height"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:tabGravity="fill"
app:tabIndicatorColor="@android:color/white"
app:tabMaxWidth="0dp"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
Run Code Online (Sandbox Code Playgroud)
但是当它扩大时它的阴影消失了.
有什么解决方案可以解决这个问题吗?可能有办法处理阴影出现/消失?谢谢.
我在折叠工具栏上遇到了一些问题。我有以下布局结构
<CoordinatorLayout>
<AppbarLayout>
<CollapsingToolbar>
<NestedScrollView>
<HorizontalRecyclerView>
</NestedScrollView>
</CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
仅当我尝试滚动NestedScrollView触摸时才会出现问题HorizontalRecyclerView。在那种情况下CollapsingToolbar不会崩溃。只需AppbarLayout停留在该位置并NestedScrollView在其下方滚动即可。我已附上一个视频,其中的所有内容都很清晰。谁能解释这个问题?谢谢。
android-recyclerview coordinator-layout android-collapsingtoolbarlayout android-appbarlayout
我在新的android.support.design.widget包中使用TabLayout.
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabIndicatorColor="@android:color/white"
app:tabMode="fixed" />
Run Code Online (Sandbox Code Playgroud)
但在平板电脑上他们看起来像
如何拉伸它们以填满整个宽度.谢谢.