简体   繁体   English

安卓UI设计的问题

[英]Problems with android UI design

I wanna apply this style into my project which contain drawer layout.我想将此样式应用到包含抽屉布局的项目中。 I have seen this website provide a very useful generator and my problem is I cant apply it into my project.我看到这个网站提供了一个非常有用的生成器,我的问题是我无法将它应用到我的项目中。 Did anyone ever experience of it?有没有人经历过? Plz share your thoughts guys :)请分享您的想法伙计:)

After downloading, be sure to extract the files, and place them into the layouts directory of your android project.下载后一定要解压文件,放到你的android项目的layouts目录下。

Then, make sure the name you have for them is lined up with the view you've set for your activity.然后,确保您为它们命名的名称与您为活动设置的视图对齐。

So if you wanted to generate the main screen, the process would be:所以如果你想生成主屏幕,过程将是:

  1. Make it on the website在网站上制作
  2. Download the .zip下载 .zip
  3. Extract the contents提取内容
  4. Move the .xml files to the layout directory of your project将 .xml 文件移动到项目的布局目录
  5. In the activity, set the content view to the name of the .xml file在活动中,将内容视图设置为 .xml 文件的名称

If you can't get it to work that way, try making a new layout in your IDE, then go to the text/code view, and directly copy+paste the content of the .xml file.如果您无法以这种方式工作,请尝试在您的 IDE 中创建一个新布局,然后转到文本/代码视图,并直接复制并粘贴 .xml 文件的内容。

I found the solution ......我找到了解决方案......

1.I hope you will download the ZIP file into that website. 1.我希望您将 ZIP 文件下载到该网站。

2.then you will unzip that file and you can get the folder. 2.然后您将解压缩该文件,您可以获得该文件夹。

3.that folder will contain the res folder. 3.该文件夹将包含 res 文件夹。

4.you will replace the res folder into your corresponding new project res. 4.您将res文件夹替换到您对应的新项目res中。

5.then you will get the error in the themes_your_given_name.//while you creating the zip. 5.然后您将在 themes_your_given_name.// 创建 zip 时收到错误。

6.Because in that file starts with _ so you just change into your new name and it will make some error. 6.因为在那个文件中以_开头,所以你只要改成你的新名字,它就会出错。

7.Go to values->themes_name and there you will change your current name and the parent theme. 7.转到 values->themes_name ,您将在那里更改当前名称和父主题。

8.And then you go to your mainfest file and change the theme of your application into you new Custom theme..like this 8.然后你去你的 mainfest 文件并将你的应用程序的主题更改为你新的自定义主题..像这样

 <application
    android:label="Trail"
    android:theme="@style/CustomOwn">   //custom theme..    

    <activity
        android:name="com.example.trail.MainActivity"
        >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM