当前位置: 首页 > 知识库问答 >
问题:

如何在android api

胡元明
2023-03-14

我在为android版本添加提升时遇到一些问题

例如:如果我想根据材质设计为抽屉布局添加立面,我应该怎么做?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/nav_header_height"
    android:background="@drawable/side_nav_bar"
    android:gravity="bottom"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:theme="@style/ThemeOverlay.AppCompat.Dark">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/nav_header_vertical_spacing"
        android:src="@drawable/ic_person_black_64dp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/nav_header_vertical_spacing"
        android:text="Android"
        android:textAppearance="@style/TextAppearance.AppCompat.Body1" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="android studio" />

</LinearLayout>

共有1个答案

孙阳旭
2023-03-14

一个解决方法是,您可以将所有这些视图放在CardView中

只需将LinearLayout放入CardView

例如:-

<android.support.v7.widget.CardView
    ....
    card_view:cardElevation="5dp"
    card_view:cardCornerRadius="0dp">


 <!--  other view that you want to elevate -->
 <DrawerLayout ../>  or <Toolbar  ---->

</android.support.v7.widget.CardView>
 类似资料:
  • 问题内容: 我有一个水平线,我需要将每个垂直线居中。我的标记如下。每个都有一个边框,我需要物品及其内容垂直位于中间。请帮忙; 我是CSS新手。 问题答案: 我假设由于您使用的是XML声明,因此您不必担心IE或较旧的浏览器。 所以,你可以使用和像这样:

  • 我在做一个宠物项目(一种游戏)。我遇到了一个问题:当从控制台用命令调用应用程序时: 播放短的声音,但不播放长的声音。所有声音都在JAR中的“/资产”文件夹中。 音频的路径如下所示: 例如射击或跳跃。对于长音频数据,仅播放前 0.5 秒。 例如:如果您加载长度为0.834秒的声音,那么它会循环(背景音乐),声音将循环播放!(WAV 文件,0.843 秒,48 KB)。但是,如果加载 WAV 文件 2

  • 问题内容: 我有下表: 如果给定的ID不存在,我想插入具有默认Val的ID。但是,如果它已经存在,我想增加Val的值。 我有以下代码: 并且它可以工作,但是我想用一个SQL语句来完成。我可以吗? 编辑 : 从@ Xikinho90的答案,我的最终代码是 问题答案: 您可以使用插入或替换。 我认为这可以解决问题 您只需要用输入的ID替换数字 谢谢奇科

  • 在Perl中,使用Moo,可以围绕sub实现sub,它将围绕类中的其他方法。 如何在Raku中实现这种行为,最好使用角色?

  • 我的注册成功。将向邮件发送通知,其中包含有关跟踪链接的请求的文本,然后激活帐户。一切都很好,但不可能将此文本转换为模板,以便将变量存储在其中,并将其发送到邮局,但我不知道如何从java代码中放置thymeleaf 使用者getUsername()用户。getActivationCode() 在我的例子中,它们以相同的形式返回,它们不会给出它们对应的用户的值 我的胸腺 我正在尝试通过上下文读取此文件

  • 我按照以下网址的说明进行了操作: https://docs.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.1 在.NET核心中创建gRPC服务和客户端,一切都很好。 接下来,我需要一个遗留的。NET框架应用程序访问该服务。我找到了一些安装的NuGet包,但没有找到任何告诉你如何使用它们来制作g