android-layout

Error in manifest - “Error parsing XML: unbound prefix”

ぃ、小莉子 提交于 2020-01-15 10:34:15
问题 My manifest.xml is, <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pilot.clicker" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> <!-- Required --> <uses-permission android:name="android.permission.INTERNET"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style

Set buttons inline and break line to fit different devices

心已入冬 提交于 2020-01-15 09:13:18
问题 I want to add some buttons in a line and break it in a new line when they reach the end of the screen: If you know CSS, what I need is similar to display: inline-block rule. I am looking for a XML solution only, I want to avoid measuring the screen and buttons using java to emplace them below programatically. This is my current code, the following buttons are inside a ConstraintLayout : <Button android:id="@+id/boton1" android:layout_width="wrap_content" android:layout_height="wrap_content"

Set buttons inline and break line to fit different devices

。_饼干妹妹 提交于 2020-01-15 09:13:02
问题 I want to add some buttons in a line and break it in a new line when they reach the end of the screen: If you know CSS, what I need is similar to display: inline-block rule. I am looking for a XML solution only, I want to avoid measuring the screen and buttons using java to emplace them below programatically. This is my current code, the following buttons are inside a ConstraintLayout : <Button android:id="@+id/boton1" android:layout_width="wrap_content" android:layout_height="wrap_content"

Android: “duplicate attribute” error problem

爷,独闯天下 提交于 2020-01-15 09:10:17
问题 I was making a simple calculator app design and mid-way I decided to test it. I though it was going to run without any errors however it shows an error like this: C:\Users\mahir\AndroidStudioProjects\SimpleCalculatorappforstudents\app\src\main\res\layout\activity_main.xml:5: error: duplicate attribute. C:\Users\mahir\AndroidStudioProjects\SimpleCalculatorappforstudents\app\src\main\res\layout\activity_main.xml: error: file failed to compile. I have searched google to solve this problem

Create a drawable with rounded top corners and a border on bottom

守給你的承諾、 提交于 2020-01-15 09:04:13
问题 This is what I came up with. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle" > <solid android:color="@color/grey" /> <padding android:bottom="1dp" /> <corners android:radius="0dp"/> </shape> </item> <item> <shape android:shape="rectangle" > <solid android:color="@color/white" /> <corners android:radius="1dp" android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp" android

how to reduce the space between icon and home up key in custom action bar in android

China☆狼群 提交于 2020-01-15 08:53:54
问题 I'm using custom action bar in AppCompatActivity. I give the my code below as well as the pitcher. i tried all solution available in stack over flow. But till i can't fix this issue.please assist me. action_toolbar.xml <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" style="@style/toolBarTheme" android:layout_width="match_parent" android:layout_height="wrap_content"

Can I get the orientation of a photo taken in my app if I limit the activity's orientation to portrait only in my manifest?

爷,独闯天下 提交于 2020-01-15 08:46:28
问题 I don't want to support landscape UI at all across my app, but I want to be able to automatically rotate the photos users take in landscape mode. Currently if a user takes a photo in landscape mode, it remains on screen as if it was taken in portrait (the horizon in the photo is vertical). I've tried to get the orientation from the system like this: val display = (getSystemService(Context.WINDOW_SERVICE) as WindowManager).defaultDisplay val screenOrientation = display.rotation Log.d(

Can I get the orientation of a photo taken in my app if I limit the activity's orientation to portrait only in my manifest?

独自空忆成欢 提交于 2020-01-15 08:46:10
问题 I don't want to support landscape UI at all across my app, but I want to be able to automatically rotate the photos users take in landscape mode. Currently if a user takes a photo in landscape mode, it remains on screen as if it was taken in portrait (the horizon in the photo is vertical). I've tried to get the orientation from the system like this: val display = (getSystemService(Context.WINDOW_SERVICE) as WindowManager).defaultDisplay val screenOrientation = display.rotation Log.d(

Samsung Galaxy Tab 7inch - Layout Issues

自闭症网瘾萝莉.ら 提交于 2020-01-15 04:25:25
问题 I have been laying out some Android xml screens on a Galaxy Samsung Tab 7" GT-P3110 which has a screen resolution of 1024 x 600. It is running Android ver 4.0.3 My customer however is running a Galaxy Samsung Tab 7" SPH-P100 with Android 2.2 with the same screen size and resolution. When the customer is viewing the screens I have created they are being cut-off width ways. Both devices appear to have the same size and resolution and I'm trying to work out why there are differences in layout ?

Adding a View to RelativeLayout changes its size

坚强是说给别人听的谎言 提交于 2020-01-15 04:08:46
问题 I have a RelativeLayout called "Dress" with LayoutParams of WRAP_CONTENT. All that is inside it is an ImageView, so it is the same size as the ImageView. When I add one more view to the RelativeLayout in OnCreate, like this: photoSorter = new MultitouchImagesView(this.getApplicationContext()); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); ((ViewGroup) findViewById(id.Dress)).addView(photoSorter, params); The