是否可以将按钮放在最上方的左上角而不是正上方?
目前我有:
private File rawToWave(final File rawFile, final String filePath) throws IOException {
File waveFile = new File(filePath);
byte[] rawData = new byte[(int) rawFile.length()];
DataInputStream input = null;
try {
input = new DataInputStream(new FileInputStream(rawFile));
input.read(rawData);
} finally {
if (input != null) {
input.close();
}
}
DataOutputStream output = null;
try {
output = new DataOutputStream(new FileOutputStream(waveFile));
// WAVE header
// see http://ccrma.stanford.edu/courses/422/projects/WaveFormat/
writeString(output, "RIFF"); // chunk id
writeInt(output, 36 + rawData.length); // chunk size
writeString(output, "WAVE"); // format
writeString(output, "fmt "); // subchunk 1 id
writeInt(output, 16); // subchunk 1 size
writeShort(output, (short) 1); // audio format (1 = PCM)
writeShort(output, (short) 1); // number of channels
writeInt(output, Constants.RECORDER_SAMPLERATE); // sample rate
writeInt(output, Constants.RECORDER_SAMPLERATE * 2); // byte rate
writeShort(output, (short) 2); // block align
writeShort(output, (short) 16); // bits per sample
writeString(output, "data"); // subchunk 2 id
writeInt(output, rawData.length); // subchunk 2 size
// Audio data (conversion big endian -> little endian)
short[] shorts = new short[rawData.length / 2];
ByteBuffer.wrap(rawData).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(shorts);
ByteBuffer bytes = ByteBuffer.allocate(shorts.length * 2);
for (short s : shorts) {
bytes.putShort(s);
}
output.write(bytes.array());
} finally {
if (output != null) {
output.close();
}
}
return waveFile;
}
private void writeInt(final DataOutputStream output, final int value) throws IOException {
output.write(value >> 0);
output.write(value >> 8);
output.write(value >> 16);
output.write(value >> 24);
}
private void writeShort(final DataOutputStream output, final short value) throws IOException {
output.write(value >> 0);
output.write(value >> 8);
}
private void writeString(final DataOutputStream output, final String value) throws IOException {
for (int i = 0; i < value.length(); i++) {
output.write(value.charAt(i));
}
}
按钮在jumbotron上方创建一个显着的栏(看起来像垃圾导航栏!)
如何将按钮放在最左上角以消除此问题?
答案 0 :(得分:2)
你走了。只需在按钮上添加绝对定位,然后将其放在您的jumbotron内,而不是在它上面。
File "d:\virEnv\lib\site-packages\django\core\handlers\base.py" in get_response
149. response = self.process_exception_by_middleware(e, request)
File "d:\virEnv\lib\site-packages\django\core\handlers\base.py" in get_response
147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\virEnv\myshop\shop\views.py" in product_list
16. 'products': products})
File "d:\virEnv\lib\site-packages\django\shortcuts.py" in render
67. template_name, context, request=request, using=using)
File "d:\virEnv\lib\site-packages\django\template\loader.py" in render_to_string
97. return template.render(context, request)
File "d:\virEnv\lib\site-packages\django\template\backends\django.py" in render
95. return self.template.render(context)
File "d:\virEnv\lib\site-packages\django\template\base.py" in render
204. with context.bind_template(self):
File "c:\python35-32\Lib\contextlib.py" in __enter__
59. return next(self.gen)
File "d:\virEnv\lib\site-packages\django\template\context.py" in bind_template
256. processors = (template.engine.template_context_processors +
File "d:\virEnv\lib\site-packages\django\utils\functional.py" in __get__
33. res = instance.__dict__[self.name] = self.func(instance)
File "d:\virEnv\lib\site-packages\django\template\engine.py" in template_context_processors
105. return tuple(import_string(path) for path in context_processors)
File "d:\virEnv\lib\site-packages\django\template\engine.py" in <genexpr>
105. return tuple(import_string(path) for path in context_processors)
File "d:\virEnv\lib\site-packages\django\utils\module_loading.py" in import_string
20. module = import_module(module_path)
File "d:\virEnv\lib\importlib\__init__.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
Exception Type: ImportError at /
Exception Value: No module named 'myshop.cart'